This is a problem that hounds PHP developers quite often. Even using WAMP it still gives this error which confused me because I did not encounter any problems when I added a new user account in MAMP.
I did exactly the same steps when adding a new database user account in WAMP and it always gives the Access denied for user ‘root’@’localhost’ (using password: YES).
To get around this problem, it is always best to use a different user account other than root. To add a new user account with the same privileges are a root user account, do the following steps:
– click the database and go to PRIVILEGES tab
– click EDIT PRIVILEGES on the entry named user:root and host:localhost
– scroll down. there should be a login information section. in the user name field, type a new username
– set a password
– then click the GO button below it. it should create the new user account with the same privileges as the root user account.
A note to consider: Make sure you change the password of the root user account because by default the password is blank.