Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This is a new install and I have only set the root passwords for localhost, and .

I know the password is correct as I can log in with root@localhost to the mysql server and can also create users. However, when I try to grant privileges to the newly created user I get the dreaded "Access denied for user root@localhost (using password: YES)" error message.


Returns:  ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

There's got to be something small that I've missed in my setup, however I cannot find it. I've been searching for a while and all I can seem to find that relates is a wrong password for the root account, and I know I've got the right one.

I've looked through numerous threads here and they all seem to relate to a lost or unknown password for the root account, which is not the case here.

share|improve this question
what are the results of running SHOW GRANTS; – becomingwisest Dec 30 '11 at 0:25
show grants returns the full permission list for root@localhost, including the WITH GRANT option. – m4rty Dec 30 '11 at 0:30
@m4rty I have the exact same issue. Have you solved this and could you post if so? – Larry B Sep 28 '12 at 15:06

The only reason for this that comes to my mind is missing privileges. Check if your root@localhost has grant privilege. You can find so by looking at SELECT * FROM mysql.user WHERE Host='localhost' and User='root'; and checking the Grant_priv column. I think you should be able to fix it by setting the column to 'Y' and doing FLUSH PRIVILEGES or restarting mysql.

share|improve this answer
Been there, checked that. The Grant_Priv = Y for root@localhost. – m4rty Dec 30 '11 at 0:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.