Hmm. Ive spent evening with exactly the same thing as you. Me using XAMPP on windows. After uploading it all and importing local database i could not connet.
User not created in the database.
If you are using MAMP at some point you created a database for wordpress and user for it. That user is like login user and password that wordpress install is gonna use whenever it needs to connect to the database. The fun part is that specially in shared hosts they usually add a prefix to the user so if your user was
and your domain is
user is set as
go to wp-config and read which user and password is wrtitten there to connect to the database
if you are using cpanel in your host go to MYSQL DATABASES forget about phpmyadmin if you compare phpmyadmin in your MAMP localhost installation with what you have in phpmyadmin in your host you will notice some tabs missing i dont know but suppose that they disable some functions like database deleting (all database not just tables) database creation, users creation and deletion, and some other things for security reasons.
so in MYSQL DATABASES scroll down until you see some options for user creation. Try to make the same you have in your MAMP install and select privileges for it (i selected all but dont know if it is necessary codex is no very specific it says all you need to use and modify).
if you notice some prefix is added and not optional just create it this way then go back to wp-config and change it user to the one you created.