ERROR 1142 (42000) at line 6688:select, LOCK TABLES command denied to user ' root ' @ ' localhost ' for t

Source: Internet
Author: User
Tags mysql version
[Root@slave2 bak]# mysql-u root-p < 20161206112352.sql
Warning:using a password on the command line interface can is insecure.
ERROR 1142 (42000) at line 6688:select, LOCK TABLES command denied to user ' root ' @ ' localhost ' for table ' accounts '
Mysql> Select Table_schema,table_name from information_schema.tables where table_name= ' accounts ';
+--------------------+------------+
| Table_schema | table_name |
+--------------------+------------+
| Performance_schema | accounts |
+--------------------+------------+
1 row in Set (0.11 sec)
and view the backup file, and you do have a backup statement that backs up the table:

Use ' Performance_schema ';

--
--Table structure for table ' accounts '
--


DROP TABLE IF EXISTS ' accounts ';
/*!40101 SET @saved_cs_client = @ @character_set_client * *;
/*!40101 SET character_set_client = UTF8 * *;
CREATE TABLE ' accounts ' (
' USER ' char CHARACTER SET UTF8 COLLATE utf8_bin DEFAULT NULL,
' HOST ' char CHARACTER SET UTF8 COLLATE utf8_bin DEFAULT NULL,
' Current_connections ' bigint not NULL,
' Total_connections ' bigint not NULL
) Engine=performance_schema DEFAULT Charset=utf8;
/*!40101 SET character_set_client = @saved_cs_client * *;

......

--I don't know why I backed up on two machines with 5.6.33 installed, one of which automatically backs up the library Performance_schema, and the other machine doesn't. Strange. Some say it is unreasonable to upgrade the MySQL version caused. I don't know.
Due to import data times error 1142 (42000) at line 6688:select, LOCK TABLES command denied to user ' root ' @ ' localhost ' for table ' account S ',
Therefore, the performance_schema.accounts data in the backup file cannot be returned.
You can comment out or delete a backup statement about Performance_schema, and then restore it.
You can also explicitly not back up your system's own libraries in this way:
Mysql-uroot-p-e ' show databases; ' | Grep-e-V "database|information_schema|mysql|test|performance_schema" |xargs mysqldump-uroot-p--databases > All.bak





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.