解决备份数据库时database ‘information_schema‘“ when using LOCK TABLES的错误

1.备份数据时的报错

mysqldump: Got error: 1044: "Access denied for user 'root'@'localhost' to database 'information_schema'" when using LOCK TABLES
mysqldump: Got error: 1142: "SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'cond_instances'" when using LOCK TABLES

2. 解决方法

在mysqldump 命令后加 --skip-lock-tables 参数即可解决
例:

mysqldump --skip-lock-tables  -B information_schema > /mysql/information_schema.sql

猜你喜欢

转载自blog.csdn.net/m0_46674735/article/details/112407786