Linux under mysql forgot root password can skip safe mode into mysql change root password;
First turn off the MySQL services,serviceMySQL stop
Then find the mysql configuration file my.cnf,
In the mysqld configuration, add:skip-grant-tables;
Restart mysql service
MySQL Stop
MySQL Start
You can enter MySQL with a blank password.
Modify root password:update user set Password=password ("New_pass") where user= ' root ';
Then comment out the previous line;
MySQL is normally used.
Windows mysql forgot root password can skip safe mode into mysql change root password;
First turn off the MySQL service;
Then go to the MySQL installation directory on the cmd command line : (for example, installing the D:\phpStudy\MySQL\bin directory);
Enter D: and Enter the d directory
Input CD "D:\phpStudy\MySQL\bin" enter into the installation directory
Enter mysqld-nt--skip-gtant-tables Enter no password mode
Reopen a CDM command interface;
Input mysql-u root-p
Enter MySQL to change the root password;
Modify command:update mysql.user set Password=password (' new password ') where user= ' root ';
MySQL forgot root password solution