Skip to main content

mysql 'root' password reset in CentOS

If you are using CentOS 6.6. To reset the root password use the following steps:-
[ahmed@server ~] sudo service mysqld stop
[ahmed@server ~] sudo service mysqld startsos
[ahmed@server ~] mysql -u root
Now you will be at mysql prompt. Here type:-
mysql> UPDATE mysql.user SET Password=PASSWORD('NewPassHere') WHERE User='root';
mysql> FLUSH PRIVILEGES;
mysql> quit;
Now restart Mysqld.
sudo service mysqld restart

Comments