Mysql – ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: YES)

MySQL

I have a server in my room on my LAN. I just rebooted my server and now when I try to connect to mysql I get the following error message

mysql -u root -p -h localhost
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

I haven't changed any settings to my knowledge and was able to log in and out until I rebooted my computer. Any advice? I know this same error message has been reported on stackoverflow and serverfault, but in the Q/A's I read they aren't connecting to localhost.

Best Answer

The procedure is about the same; restart MySQL in safe mode log in with root and no password and perform a password reset. From there do a data integrity check.