1. The first step is to reset the password of password authentication process is skipped MySQL, as follows:
#vim /etc/my.cnf (Note: the windows are modified my.ini)
In the document search target mysqld [mysqld] text segment:
/ mysqld (the command is entered directly in the edit state vim searchable text)
In [mysqld] Add any line behind the "skip-grant-tables" to skip the password authentication process, as shown below:
Save the document and exit
2. Next, we start mysql
3. reset the password for the root user
Enter mysql
into the mysql command-line interface:
reset Password:
update mysql.user set authentication_string = password('new_password') where user = 'root';
flush privileges;
Here the root account has been reset to the new password.
4. Edit my.cnf, remove content just added, and then restart MySQL. We're done!
Note:
new_password
on behalf of the root user's new password, you need according to their actual situation to replace