MySQL execution show databases no MySQL library

Source: Internet
Author: User

On the Internet to check the relevant cases, found that the Authority table Mysql.user table related

Workaround:
Close the database
Service Mysqld Stop

Start MySQL with skip permission authentication
Mysqld_safe--defaults-file=/etc/my.cnf--skip-grant-tables &

Delete a record of host named ' localhost ' in the Mysql.user table
mysql> use MySQL
mysql> Delete from user where host= ' localhost ';
Query OK, 7 rows Affected (0.00 sec)

mysql> INSERT into ' user ' VALUES (' localhost ', ' root ', ', ' y ', ' y ', ' y ', ' y ', ' y ', ' y ', ' y ', ' y ', ' y ', ' y ', ' y ', ' y ', ' Y ', ' y ', ' y ', ' y ', ' y ', ' y ', ' y ', ' y ', ' y ', ' y ', ' y ', ' y ', ' y ', ' n ', ', ', ', ', ', ', ', ', ', ', ', 0,0,0,0
Query OK, 1 row Affected (0.00 sec)

Mysql> commit;
Query OK, 0 rows Affected (0.00 sec)

After restarting the database again, the normal
Service mysqld Restart

Mysqld_safe--DEFAULTS-FILE=/ETC/MY.CNF &

Change root password
Mysqladmin-u root-proot Password

MySQL execution show databases no MySQL library

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.