What if MySQL forgets the root password?
What if MySQL forgets the root password? In general, there are two ways of thinking: Retrieve the password and reset the password. In the actual work, the MySQL database forgot the root password is generally used to reset the password method to solve. Here's a look at the steps to reset the root password under Linux and under Windows.
What happens when MySQL forgets the root password under Windows?
1. Log on to the system as a system administrator and start the MySQL skip permission check.
D:\mysql\bin\mysqld-nt–skip-grant-tables
2. Go to D:\mysql\bin and set the password using the mysqladmin command
D:\mysql\bin\mysqladmin-u root flush-privileges password "new password"
3. Restart MySQL in cmd
net start MySQL
What if MySQL forgets the root password under Linux?
1. Start MySQL with the following command to start without checking permissions;
[Email protected] mysql]# Safe_mysqld–skip-grant-tables &
[Email protected] mysql]# Mysqld–skip-grant-tables &
2. Then log in to MySQL using the root user with a blank password
[Email protected] mysql]# mysql-u root
3. Change the password of the root user;
mysql> Update Mysql.user Set Password=password (' New password ') where user= ' root ';
mysql> flush Privileges;
Restart MySQL and you will be able to log in with your new password.
Dry----004----MySQL forgot the root password?