Disk space was full on my server and I needed to do a mysqldump. I tried logging into MySQL, but temporarily forgot the password. I then tried using the
--skip-grant-tables & , but I received an error and it did not work. I tried several times.
I finally got hold of the correct password, but I encountered an issue that:
Can't connect to local MySQL server through socket '/var/lib /mysql/mysql.sock'
Somehow I was able to get rid of that error through lots of trial and error, but now I can still not login.
Enter password: ERROR 1045 (28000): Access denied for user 'root'@'localhost'(using password: YES)
I need to reset the password for MySQL without losing data.