(1) Linux system
You can reset the MySQL password to Diavps by executing the following command in SSH
Copy Code code as follows:
Rm-f Reset-mysql-root-password.phps
wget Http://down.hostwiki.info/mysql/reset-mysql-root-password.phps
PHP Reset-mysql-root-password.phps Diavps
Be careful not to use this method to reset in an environment with a management panel such as Kloxo or DA.
The command to start MySQL in Safe mode on line 13th of the script will vary depending on the MySQL installation path.
The MySQL service name used in the script is mysqld, the service name may be MySQL in some systems, please note the modification.
(2) Windows system
1, first stop the running MySQL process
net stop MySQL
If it is not loaded as a service, it can be shut down directly in the process manager.
2. Start MySQL in safe mode
Run at the command line
X:/mysql/bin/mysqld-nt.exe--skip-grant-tables
3, after the completion of the password can not enter the MySQL
X:/mysql/bin/mysql-u root-p
When prompted to enter a password, you can return directly.
4. Change Password
>use MySQL
>update User Set Password=password ("New password") where user= "root";
>flush privileges;
5. Start MySQL
In Task Manager, close all MySQL processes and start using the following command.
net start MySQL