MySQL - Linux - RESTORE MySQL Server ROOT Password

Published: 14 March 2013
on channel: Davids Videos
10,120
40

In this tutorial I show you how to reset the root pasword for your mysql-server if you have either forgotten it or didnt ever know it. You need to be logged in as root on the server in order to change the root password of the mysql server. Firstly you need to stop the mysql service by issuing the command, "service mysqld stop", then you can issue the next command of "mysqld_safe --skip-grant-tables", this will then start the mysql server without checking the privileges and especially the password. Once you have done this you will need to open another terminal window, and simply issue the command "mysql", this will log your straight into the server. Now, execute an update command to change the password of the root user, in the user tables of the mysql database. "update mysql.user set password=PASSWORD('password') where User='root';". Execute the command, it should then tell you that there have been rows affected. From this point you need to flush privileges...which I forgot to mention...Ooooops. Although as you can see from the video everything worked just fine. From this point on you can login as normal. Firstly you will be required to restart the mysqld service once again, because it is still running in mysqld_safe mode. Issue the command, "service mysqld restart" then you can login to mysql normally, providing a password and username if required.


Watch video MySQL - Linux - RESTORE MySQL Server ROOT Password online without registration, duration hours minute second in high quality. This video was added by user Davids Videos 14 March 2013, don't forget to share it with your friends and acquaintances, it has been viewed on our site 10,120 once and liked it 40 people.