Resetting MySQL Root Password on CentOS
Resetting MySQL Root Password on CentOS – Plugged.inPlugged.in
Written by: M. Emre Aydin on November 17, 2012.
It is not uncommon for you to need the MySQL root password of a server, especially when you’re dealing with hundreds of different servers. Here’s the quickest way to reset it. (Don’t forget that you need to login to your server as root in order to achieve this)
1) Start MySQL in safe mode.
2) Reset the root password.
3) Flush privileges.
4) Create a my.cnf file so that you can automatically log-in next time.