This article is a mirror article of machine translation, please click here to jump to the original article.

View: 13752|Reply: 2

[Tips] Use phpmyadmin or the command line to modify the root password of mysql, and find the solution to the mysql login error after restarting....

[Copy link]
Posted on 11/18/2014 6:52:27 PM | | |
Many people use phpmyadmin or the command line to change the root password of mysql, and after restarting, they find that mysql login error is found, why is this?
To change the password of mysql root, you need to change the password of root in the mysql database in the mysql software, and also change it in the configuration file.
And the modification in the database is not only to modify one line of data, so do not modify it manually, but use commands to modify.


First, log in to phpmyadmin with the root account, then click on the left side to enter the mysql database, and click "mysql" at the top to enter the sql input interface. Enter the following command:
update user set password=password('123456') where User='root'
Among them, 123456 is the password you want to change, so remember not to change the password directly in the database.

Then click "Execute" in the lower right corner and see "Affected x lines", which means that the modification is successful.


Changing the password is basically done here, but there will be a follow-up problem, the database password is changed, and when you exit phpMyAdmin and come in again, you will find that you can't connect to the database.
This is because the database login information in phpMyAdmin is still the original, so it cannot be logged in.


Solution: Open the installation directory of phpMyAdmin, find the config.inc.php file, and open it with Notepad or another text editor.


Find $cfg['Servers'][$i]['password'] = ''; Change to the new password you just set, save and exit.


Open phpMyAdmin again, you can connect normally, and the password change is complete.






Previous:The Windows system teaches you to hide folders and add passwords without any software
Next:C# _OOP knowledge point notes
Posted on 11/18/2014 6:55:23 PM |
I directly use phpmyadmin to change the root password, why didn't this error occur?
 Landlord| Posted on 11/18/2014 7:11:58 PM |
admin posted on 2014-11-18 18:55
I directly use phpmyadmin to change the root password, why didn't this error occur?

I remember that phpmyadmin couldn't log in, because the configuration file password hadn't been changed (wamp), maybe it's a version problem
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com