Three minutes to learn how to recover mysql password

1. In testing, we will certainly write sq query help us verify that the data is correct, in order to determine the current software is flawed, but the process queries certainly we need to connect to the database, if the database password forget that we will not be able to complete the work , here the church you how to quickly change your password, and reset the database password, which greatly improved the work efficiency of our work

Second, we first need to learn how to modify the data mysql password here navicat use to connect to the database and this is the work of the most commonly used software

  • Mysql directory under the file to open navicat following figure first find the location of their stored passwords, stored in their own plant library to find the best found in a user table that is used to store the database password, the corresponding user name and password

Three minutes to learn how to recover mysql password

 

  • Then click Query button to create a new query way, we modify the corresponding mysql password is to write a sql statement follows

update user set password=password('123') where user='root';

flush privileges; changes need to refresh the rights to take effect

Three minutes to learn how to recover mysql password

 

  • Such is successfully modified mysql password and then restart the mysql service where local services, directly off navicat open again when connecting to the database will explain the connection fails database connection fails, you need only enter a password after re-editing can be modified as shown

Three minutes to learn how to recover mysql password

 

Three minutes to learn how to recover mysql password

 

Third, the above is how to change the password, if one day forget the password, they also do not uninstall reload the database, the data below demonstrates how to reset your password

  • Address Location: (Program Files (x86) MySQLMySQL Server 5.1 C) in the following figure to find the location of database installation file to find a http://my.int

Three minutes to learn how to recover mysql password

 

• Use Notepad to find [mysqld] add the following piece of code below this line so that you can log in without a password database skip-grant-tables and then re-refresh mysql service after saving this after opening the file so that when you do not need a password also connected succeed.

It can re-set a new password in accordance with the above operation to change the password after successful login •

• update user set password=password('123') where user='root';

flush privileges; changes need to refresh the rights to take effect

After this password is the new password forgot password only need to remember later uninstall the software not worry too much heavy equipment.

Guess you like

Origin blog.csdn.net/itcast_cn/article/details/91450324