In linux and windows, you can reset the mysql user name and password. For more information, see.
In linux and windows, you can reset the mysql user name and password. For more information, see.
(1) Linux
Run the following command in SSH to reset the MySQL password to diavps.
The Code is 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)
Do not use this method in an environment with a Management Panel (such as Kloxo or DA.
The command for starting MySQL in safe mode in line 1 of the script varies depending on the MySQL installation path.
The mysql service name used in the script is mysqld. In some systems, this service name may be mysql. Please modify it.
(2) Windows
1. Stop the running MySQL process
Net stop mysql
If it is not loaded as a service, you can close it directly in the Process Manager.
2. Start MySQL in Safe Mode
Run
X:/MySQL/bin/mysqld-nt.exe -- skip-grant-tables
3. You will be able to access MySQL without a password.
X:/MySQL/bin/mysql-u root-p
Enter the password and press Enter.
4. Change the password
> Use mysql
> Update user set password = password ("new password") where user = "root ";
> Flush privileges;
5. Start MySQL
Close all MySQL processes in the task manager and start them with the following command.
Net start mysql