The MySQL database disappears if the MySQL root password is not modified by the password () function under the Linux system. Some people may not know and directly modify the root password of MySQL, resulting in the MySQL database disappears problem, this time how to deal with it?
650) this.width=650; After modifying the root password of MySQL under "alt=" Linux, how to deal with the database disappear? "Src=" http://www.xitongzhijia.net/uploads/allimg/160116/64-16011615032M40.jpg "style=" Font-family:inherit; font-style:inherit;font-weight:inherit;vertical-align:middle;border:0px;margin:0px Auto;width:500px;height : 306px; "/>
You can use the following methods to solve:
1. Modify the MySQL database directory configuration file: My.cnf (or My.ini)
[Mysqld] under Add:
Skip-grant-tables
2. Restart the MySQL service and log in with MySQL.
3, after entering, you can see that the MySQL database has been rendered, and then modify the password:
Update user set Password=password (' root ') where user= ' root ';
Flush privileges;
4, quit MySQL, modify the configuration file my.cnf the Skip-grant-tables just commented out.
5, restart the MySQL service, and then you can use the user name, password login.
The above is the Linux under the root password modified after the database disappeared processing method, next time if you want to the root password for MySQL, remember to use the password () function, so as not to cause unnecessary loss.
This article is from "Go far." blog, declined to reprint!
Database disappears after modifying MySQL root password under Linux