MySQL - recover root password

# find out mysql process
ps -ef grep mysql

# kill mysql process
kill -9 [pid]

# startup mysql
usr/bin/safe_mysqld --skip-grant-tables

mysql> use mysql
mysql> update user set password=password("new_pass") where user="root";
mysql> flush privileges;


# restart mysql

Comments