Database disappears after modifying MySQL root password under Linux

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.