shell> /etc/init.d/mysql stop
Now start up MySQL again, bypassing the grant tables and assign a new password for the MySQL root user:
shell> cd /usr/bin
shell> ./mysqld_safe --skip-grant-tables 1>/dev/null 2>&1 &
shell> mysql -u root
mysql> use mysql
mysql> UPDATE user SET Password=PASSWORD('newpassword') WHERE user='root';
mysql> exit;Now, find all MySQL Processes and kill them explicitly as root:
shell> ps ax | grep mysql
shell> kill xxxxNow, you can start MySQL again with the normal startup parameters, the password is now changed:
shell> /etc/init.d/mysql start