This question already has an answer here:
For some reason when I installed MySQL on my machine (a Mac running OS X 10.9) the 'root' MySQL account got messed up and I don't have access to it, but I do have access to the standard MySQL account 'sean@localhost' which I use to log into phpMyAdmin.
I am trying to reset the 'root' password by starting the mysqld daemon using the command
mysqld --skip-grant-tables and then running the following lines in the mysql> shell.
mysql> UPDATE mysql.user SET Password=PASSWORD('MyNewPass')
-> WHERE User='root';
mysql> FLUSH PRIVILEGES;
Problem is when I try to run that MySQL string the daemon spits back a
ERROR 1142 (42000): UPDATE command denied to user ''@'localhost' for table 'user' as if I didn't use the -u argument when I started the mysql shell, either though I did.
Any help is muchly appreciated as I am lost at this point. :/