Credentials for the article go here:

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:

sudo service mysql stop

Second step is to run MySQL in safe mode without asking password. In order to do that, one can use a command as follows:

mysqld_safe --skip-grant-tables 

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:

mysql --user=root mysql

As soon as we connected, hereby is a list of commands which help one to change the password:

update user set Password=PASSWORD('new-password') where user='root';
flush privileges;

After that one needs to kill mysqld process and restart MySQL in normal mode.

About Us

Out Mission

Our mission is to fill the gap between modern technologies and real life experience.

Our Goal

Together with our customers gain in revenue and business efficiency by using cutting-edge technologies.

Payment Methods

We are using secure Paypal & Money-bookers payment method as well as wire transfer. You can pay directly form your Credit Card via Moneybookers or Paypal and NEVER store your card information on our site

Contact Us

Address : Chemin Vert 9, 1804 Corsier-sur-Vevey, Canton Vaud, Switzerland
Phone : +41 (21) 522.07.20