Mysql administrator password recovery

1, sent to the mysqld server kill command to turn off the mysqld server (not kill -9), the process ID of the file storage directory is usually located in the MYSQL database / var / lib / mysql in.

# Killall -TERM mysqld

 

2, using --skip-grant-tables parameter to start mysqld.

# / Usr / bin / safe_mysqld --skip -grant-tables

The path is not always the same, you can find it with locate.
3, no password then you can log in to mysqld server, this time password and Mysql installed just the same, they are empty. Now we can use mysqladmin mysql to change the password.

#mysqladmin -u root -p password newpassword

4, load permission table, use the following command

# mysqladmin flush-privileges

Guess you like

Origin www.cnblogs.com/56843268qqq/p/12341311.html
Recommended