Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

This is a new install and I have only set the root passwords for localhost, 127.0.0.1 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.

GRANT ALL PRIVILEGES ON *.* TO 'myUserName'@'localhost' IDENTIFIED WITH 'myUsersPass' WITH GRANT OPTION;

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

1 Answer 1

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

 
discard

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.