Created: Tuesday, 07 January 2014
Credentials for the article go here: http://www.howtoforge.com/reset-forgotten-mysql-root-password
Sometimes, we need to take over MySQL server, and this article explains how one can change root password for MySQL server.
If you logon locally or by using remote ssh connection, first this to do is to stop MySQL server service by typing the following command:
Second step is to run MySQL in safe mode without asking password. In order to do that, one can use a command as follows:
If it starts, you can see the message from the system. In my case, I needed to start another ssh session in order to continue.
Now we can connect with mysql client by the following command:
As soon as we connected, hereby is a list of commands which help one to change the password:
After that one needs to kill mysqld process and restart MySQL in normal mode.