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