Reset MySQL password bitsCN.com in Linux
Reset the MySQL password in Linux
According to relevant information, there are usually not many passwords that people can remember. many times, people use the same password for multiple accounts. However, the password of an account that is frequently accessed will not be forgotten. However, when you forget the MySQL password, the following describes how to forget the MySQL password in Linux. In fact, it is very simple. it only takes six steps to solve the problem. If you don't talk about it, go to the topic:
1. close the MySQL service:
Service mysqld stop
2. run the following command to exit the security mode. of course, this command is only valid when localhost is used.
/Usr/local/mysql/bin/mysqld_safe-skip-grant
3. enter MySQL
/Usr/local/mysql/bin/mysql-u root-p to enter mysql
4. change the password and execute the following statement:
Use mysql;
UPDATE user SET Password = password ("XXX") WHERE User = "root"; where xxx is the Password you want to SET
Flush privileges;
Exit;
5. remove skip-grant from the configuration file, modify the configuration file, set the configuration file to my. cnf in linux, set the configuration file to my. ini in windows, and add it under [mysqld ].
Skip-grant
6. start the MySQL service:
Service mysqld start
BitsCN.com