The loss of the password is very distressing things, especially the root password lost: (. I pretend to play lost also lost, but in case it is a server hanging trouble can be big! Now assume that the root password was lost because of the intrusion. Here I would like to talk about my own views on such a problem. First of all, we do not need to panic, the whole recovery process is very simple.
1 download MySQL source distribution, do not differentiate the operating system, we need the same thing.
2 Rename your MySQL folder under the data directory for Oldmysql.
3 Copy the MySQL directory under the data directory in the source package to your MySQL data directory.
4 Restart MySQL, now the MySQL licensing relationship with the new installation of the same, empty password login, and then adjust the authorization.
5 Open Oldmysql This library to check what's going on.
6 If there is a backup of the system in the central database integrity testing to avoid being modified.
With the above 6 steps you can completely restore your control of MySQL, focusing on the last two steps to check each other's permissions, and data integrity detection.