-Log in to your account using SSH.
-Stop the MySQL server using the appropriate command for your Linux distribution
For Debian and Ubuntu, type:
-Restart the MySQL server with the —skip-grant-tables option. To do this, type the following command:
-Restart the MySQL server with the —skip-grant-tables option. To do this, type the following command:
mysqld_safe --skip-grant-tables &
-Log into MySQL using the following command:
mysql
-At the mysql> prompt, reset the password. To do this, type the following command, replacing NEW-PASSWORD with the new root password:
UPDATE mysql.user SET Password=PASSWORD('NEW-PASSWORD') WHERE User='root';
-At the mysql> prompt, type the following commands:
FLUSH PRIVILEGES; exit;
-Stop the MySQL server using the following command. You will be prompted to enter the new MySQL root password before the MySQL server shuts down:
mysqladmin -u root -p shutdown
-Start the MySQL server normally. To do this, type the appropriate command for your Linux distribution:
For Debian and Ubuntu, type:
service mysql start