Error establishing a database connection on another machine

I’ve developed a wordpress site on my Dell laptop. It works fine. I installed WAMP on my HP and created a DB with the same name with the one on my dell, replicated the folder structure to mimic how everything is on my Dell and also backed up the Wordpress DB from my Dell to be transferred to my HP Laptop. I’ve created a database with the same name on my HP and uploaded the sql files. Everything looks the same on the 2 laptops but i don’t know why i’m getting this error:

Error establishing a database connection

Check the values that your using for Wordpress to connect to it’s database are correct in the wp-config.php file.

Also make sure that the user you created has access on ‘%’ (or the IP of your Wordpress computer).

So, for example, if you go MySQL Workbench or some other way to look at the users, you should have something like ‘root’@‘%’. ‘root’@‘localhost’ will only let you use that user on that specific computer.