For users of the powerful database
MySQL, access, as well as right to modify the
admin (root) password is important, because both are required when
installing and in situations when the
master password is lost. The user must be connected to the
root password to modify it but for reinitialising the password, this process can be skipped. Resetting the password is possible after connection to the
MySQL database with the help of
specific commands. In case the password is lost, then it is also possible to get access to the
MySQL server through a
bypass of the authentication process. To reset the password under the latter condition, the
server must be restarted to continue the process.
It's important that you are able to access and modify the admin (root) password of MYSQL, either when installing MySQL for the first time or in situations where the master password is lost.
The root password is lost
To modify the existing root password, you must firstly be connected to it. If you know the root password and just want to reinitialize it, you can skip this part. If you don't have the root password then follow the steps below:
- Stop the MySQL server
- Restart MySQL, disabling network communication and skipping the authentication procedure
Resetting the password
- Get connected to the MySQL system database:
- Type in the following command and reset your password:
- If you didn't go through the first step, to validate the changes simply type:
- If you started MySQL manually (bypassing the authentication process), the server must be restarted:
Warning: Changing your password can cause connection problems between phpmyadmin and mysql.
See also
Knowledge communities.
Original article published by
Jeff. Translated by
jak58. -
Latest update by Jeff