I am posting this for my future reference. Also it my help passers by.
If you are using CentOS 6 (maybe others too). To reset the root password use the following steps:-
- sudo service mysqld stop
- sudo service mysqld startsos
- mysql -u root
- Now you will be at mysql prompt. Here type:-
- UPDATE mysql.user SET Password=PASSWORD(‘NewPassHere’) WHERE User=’root’;
- FLUSH PRIVILEGES;
- quit;
- sudo service mysqld restart