Resetting the MySQL password in Linux according to relevant information, there are usually not many passwords that can be remembered. In many cases, the password can be set with multiple accounts and passwords. 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. Don't talk about it. Let's go to the topic: www.2cto.com 1. Shut down the MySQL service: service mysqld stop 2. Execute 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 www.2cto.com 3. Enter MySQL/usr/local/mysql/bin/mysql-u root-p to enter mysql 4. Change the password, run 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 the skip-grant in the configuration file and modify the configuration file. The configuration file in linux is my. cnf. The configuration file in windows is my. ini, add skip-grant 6 under [mysqld], start MySQL service: service mysqld start