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

/etc/init.d/mysql stop

mysqld_safe --skip-grant-tables &

mysql -u root

use mysql;
update user set password=PASSWORD("NEW_PASSWORD") where User='root';
flush privileges;
quit;

/etc/init.d/mysql stop
/etc/init.d/mysql start

mysql -u root -p
 
Reference:-
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES) (2014). Available at: http://stackoverflow.com/questions/21944936/error-1045-28000-access-denied-for-user-rootlocalhost-using-password-y