ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

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.


Here is the list of steps I followed to solve this problem (from http://24x7servermanagement.com/blog/?p=44)

#service mysqld stop or
#killall mysqld
#/usr/bin/mysqld_safe –skip-grant-tables&
#/usr/bin/mysql
mysql>use mysql;

Change the MySQL admin(root) Password using following command

mysql>update user set password=password(‘wsarxaffa’) where user=’root’ and host=’localhost’;

Flush the privileges so everything will take (It removes any privileges set by the server)

mysql>flush privileges;
mysql>quit
/etc/init.d/mysqld stop
/etc/init.d/mysqld start
mysql -u root -p