Home > Backend Development > PHP Tutorial > What should I do if MySQL loses my root password?_PHP Tutorial

What should I do if MySQL loses my root password?_PHP Tutorial

WBOY
Release: 2016-07-13 17:01:55
Original
793 people have browsed it

Author: Wang Meng (HeartIcy@163.com)
Losing your password is a very sad thing, especially losing the root password :(. Pretend it yourself
If you lose it for fun, you will lose it, but what if it is If the production server is down, it will be very troublesome!
Now let’s assume that the root password is lost due to the intrusion. Here I will talk about my own
views on such a problem.
I encountered this problem first. We don’t need to panic, the whole recovery process is very simple.
1 Download the MySQL source code distribution package. There is no need to distinguish the operating system. The things we need are the same
2. Rename your own mysql. The mysql folder under the data directory is oldmysql.
3 Copy the mysql directory under the data directory in the source code package to your mysql data directory
4 Restart mysql, now the authorization relationship of mysql. Just like a new installation, log in with an empty password
and then adjust the authorization yourself.
5 Open the oldmysql library to check what the problem is.
6 If there is a backup, check the integrity of the original database in the system. Detect to avoid being
modified.
You can completely restore your control over mysql through the above 6 steps. The key point is to check the permissions that the other party has changed and the integrity of the data in the last two steps. Sex test.



http://www.bkjia.com/PHPjc/631134.html

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/631134.htmlTechArticleAuthor: Wang Meng (HeartIcy@163.com) It is very sad to lose your password, especially the root password. :( . If you lose what you are pretending to be, you will lose it, but what if the production server crashes...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template