Does MySQL forget root password swelling? -_-||| This is not a very common situation, but sometimes the system is not logged in for a long time, and it really forgets the password. At this time, if you can access the password with system administrator privileges, it is still saved. Enlarge the Strokes and reset them.
1. Modify the MySQL login settings
Vi/etc/mysql/my.cnf
Add a sentence to the paragraph in [mysqld]: Skip-grant-tables
: Wq
Save Settings and Exit VI
2. Restart Mysqld
sudo service MySQL restart
3. Log in and modify the root password of MySQL
Go to MySQL Environment
Mysql
Switch to "MySQL" Database
Use MySQL;
Change root password
UPDATE user SET Password = Password (' New-password ') WHERE user = ' root ';
Make effective
Flush privileges;
Exit MYQL Environment
\q
5. Change the MySQL login settings back
Vi/etc/mysql/my.cnf
Delete the skip-grant-tables you just added in the paragraph [mysqld]
: Wq
Save and Exit VI
6. Restart the MySQL service
sudo service MySQL restart
The operation is complete.
original articles, reproduced please specify: reproduced from http://www.mr-wu.cn/Wuchuanbin blog
This article link address: Ubuntu under MySQL forgot root password reset http://www.mr-wu.cn/mysql-reset-root-password-on-ubuntu/
Ubuntu under MySQL forgot root password reset