Re: mySQL ERROR 1045 (28000): Access denied for user 'root'@'localhost
Run your last command using sudo after stopping the mysql service
The latter wiil, in my experience, not return to a command prompt
sudo service mysql stop
sudo mysqld --skip-grant-tables
In another terminal, start the mysql client and select the mysql database. If the root user entries are still there, just set a password using update user set password=password('yourpassword') where user='root'.
If there are no root entries, use grant all privileges on *.* to 'root'@'localhost' identified by 'yourpassword' with grant option.
Next exit the client, find the pid of the running mysql daemon and kill it.
Start the mysql daemon using sudo service mysql start and try again to get in.
PS you can ignore warnings about lower-test and higher-test.
Last edited by Wim Sturkenboom; September 1st, 2011 at 08:55 AM.
If you don't make backups of your important data, your data is obviously not important to you.