To be able to modify the existing root password, you must firstly be connected to it. If you already know the root password and just want to reinitialize it, you can skip this part. In the case that you don’t have the root password then follow the steps below. It is possible to bypass the authentication process and to access MySQL:
Stop the MySQL server with this command in terminal
sudo /etc/init.d/mysql stop
Now restart MySQL, disabling network communication and skipping the authentication procedure.
sudo mysqld –skip-grant-tables –skip-networking &
To Reinitializing the password follow the steps below….
sudo mysql mysql -u root (To get connected to the system database 'mysql' of MySQL)
Type the following command and reset your password
UPDATE user SET password=PASSWORD('newpassword') WHERE user="root";
If you didn’t go through the first step, to validate the changes simply type
FLUSH PRIVILEGES;
If you started MySQL manually(bypassing the authentication process), the server must be restarted:
sudo /etc/init.d/mysql restart
Now you are done. Enjoy












Recent Comments