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.
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 theGrant_priv
column. I think you should be able to fix it by setting the column to'Y'
and doingFLUSH PRIVILEGES
or restarting mysql.