The first thing you encounter when you start learning MySQL during the holidays is to change the MySQL root Password. The previous modification of the MySQL root Password is not very clear about the actual operation. Therefore, one week is usually used to modify the MySQL root Password. The following article is also a mentor to help me out of the predicament.
Forgetting the ROOT password for MySQL (the best combination with PHP) is a common problem in MySQL (the best combination with PHP), but many friends will not reset the ROOT password, I have deep feelings. I will share this article with you:
1. Edit the MySQL configuration file (the best combination with PHP:
In windows: % MySQL (the best combination with PHP) _ installdir % \ my. ini // I. ini is the configuration file of MySQL (the best combination with PHP.
In linux:/etc/my. cnf
Add the following line in the [MySQL (best combination with PHP) d] configuration section:
Skip-grant-tables
Save and exit editing.
2. Restart MySQL (the best combination of PHP and MySQL ).
In windows:
Net stop MySQL (the best combination with PHP)
Net start MySQL (the best combination with PHP)
In linux:
/Etc/init. d/MySQL (the best combination with PHP) d restart
3. Set a new MySQLROOT password.
Then run the following command in the command line:
MySQL (the best combination with PHP)-uroot-p MySQL (the best combination with PHP)
Press enter to enter the database without a password.
Run the following statement to update the password of MySQLroot to 7758521:
- update user set password=PASSWORD("7758521") where user='root';
Quit exits MySQL (the best combination with PHP ).
4. Restore the configuration file and restart the service.
Then, modify the MySQL configuration file (the best combination with PHP) to delete the line added.
Restart MySQL (the best combination with PHP) again, and the password is changed.
Modification completed.
Use the new password 7758521 to try it out. Can I log on to MySQL again (the best combination with PHP?
The above content is an introduction to modifying the MySQL root password. I hope you will get some benefits.