2

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.

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

1 Answer 1

0

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.

1
  • Been there, checked that. The Grant_Priv = Y for root@localhost.
    – m4rty
    Dec 30, 2011 at 0:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .