How to reset forgotten mysql root password on centos

Posted: June 11, 2014 in CentOS, Linux, mysql

# service mysqld stop
# mysqld_safe --skip-grant-tables &
# mysql --user=root mysql

MYSQL> update user set Password=PASSWORD('new-password') where user='root';
MYSQL> flush privileges;
MYSQL> exit;

# service mysqld restart

This is the source.

Leave a comment