Reinitializing the root password of MySQL

Last update on August 8, 2009 10:27 AM by jak58
Published by jak58

Reinitializing the root password of MySQL







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 be able 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. In the case that you don’t have the root password then follow the steps below.
It s is possible to bypass the authentication process and to access MySQL:

Stop the MySQL server.

#/etc/init.d/mysql stop


Restart MySQL, disabling network communication and skipping the authentication procedure.

#mysqld --skip-grant-tables --skip-networking &

Reinitializing the password:

  • Get connected to the system database (mysql) of MySQL:


# mysql mysql -u root
  • Type in 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:


#/etc/init.d/mysql restart
Best answers for « Reinitializing the root password of MySQL » in :
[Gentoo Linux]- Restoring the root password Show [Gentoo Linux]- Restoring the root password If you lose your root password the easiest way to recover it is to use the LiveCD Boot with the LiveCD Launch the fdisk command and then use the p option for the device on your boot...
PhpMyAdmin - Access denied for user root@localhost Show PhpMyAdmin - Access denied for user root@localhost To reset the rights of the root user Insert the host and password Beginners may face the problem of accessing MySql by the root user. This issue happens when the root requires you...
How to reset your OS X password without an OS X CD? ShowHow to reset your OS X password without an OS X CD? Issue Solution Note Issue I forgot my admin password and I lost my OS X disk! How can I reset the admin password? Solution Here is the best and easiest way how to reset your OS X...
MySQL console: Redirect standard output ShowMySQL console: Redirect standard output MySQL client command must be common to you (mysql), with this small tip you should be able to redirect the output commands to any program? To do this, simply use the pager command, followed by...
Download Google OS (0.4.207 beta) ShowDownload Google OS (0.4.207 beta) Intro Installation Intro Google Chrome OS a new operating system built around Google Chrome. It is still a beta version based on Linux and note that it is free and. The download is at this address...
Download Password Cracker ShowEach time you must create a count on Websites, he asks you for an identifying or "Login" and for a password. Then when you have a good time giving different names and different passwords for every count, it is rather easy to forget it. Password...
Download Password Generator Professional 2009 ShowSave time when you need to generate a large number of passwords or license keys by using Password Generator Professional, a powerful application capable of creating strong passwords from random numbers. Advantage The program offers a truly...