MySQL is rarely used. I am working on MySQL today. I don't know the MySQL Root Password. Find the reset method on Google:
1. Stop the running MySQL process
In Linux, run killall-term mysqld
In Windows, if it is written as a service, you can run: net stop mysql. If it is not loaded as a service, you can directly close it in the Process Manager.
2. Start MySql in Safe Mode
Run/usr/local/MySQL/bin/mysqld_safe -- skip-grant-tables &
In Windows, run X:/MySQL/bin/mysqld-nt.exe -- skip-grant-tables on the command line
3. You will be able to access MySQL without a password.
In Linux, run/usr/local/MySQL/bin/MySQL-u root-P to enter
In Windows, run X:/MySQL/bin/MySQL-u root-P to enter
4. Change the password
Use commands to modify
/Usr/local/MySQL/bin/mysqladmin-u root-P password New Password
Or use SQL to modify:
> Use MySQL
> Update user SET Password = PASSWORD ("new password") where user = "root ";
> Flush privileges;
Note: For version 4.1 or later, use the old_password () function to change the password.
However, an error occurred while using net start MySQL after the operation:
C: \> Net start MySQL
A system error has occurred.
System Error 1067 has occurred.
The process terminated unexpectedly.
Then Google searches for the solution as follows:
C: \ mysql \ bin \ mysqladmin-u root-P Shutdown
Net startMySQLNo suchErrorPrompt!