时间:2021-07-01 10:21:17 帮助过:78人阅读
附录:
附录1:mysqldump: Got error: 1142: SELECT,LOCK TABL command denied to user ‘root’@‘localhost’ for table ‘cond_instances’ when using LOCK TABLES
在mysql5.5中增加了performance_schema,当我们进行mysqldump的时候,会报如下错误信息:
mysqldump: Got error: 1142: SELECT,LOCK TABL command denied to user ‘root’@‘localhost’ for table ‘cond_instances’ when using LOCK TABLES
我们可以在mysqldump中加上参数 –skip-lock-tables,如
# mysqldump -uroot -p --skip-lock-tables performance_schema > performance_schema.sql
或者过滤掉performance_schema这个库
# mysql -e "show databases;" -uroot -p| grep -Ev "Database|information_schema|mysql|test|performance_schema" | xargs mysqldump -uroot -p --databases > mysql_dump.sql
mysqldump备份数据库时排除某些库
标签: