Recover Lost Root Password in mysql
-----------------------------------
Login as UNIX root
STOP mysqld (/etc/init.d/mysqld stop)
START MySQLD (/ usr / bin / safe_mysqld --skip-grant-table)
Login Into The MySQL Server (MySQL -U Root MySQL)
Change the root password (update user set password = password ('new_password') where user = 'root';)
Flush the privileges for the change to take effect (flush privileges;)
EXIT The Database (QUIT)
Stop The Database (Might Need To Kill The Process)
Restart the database as normal (/etc/init.d/mysqld start)