执行mysqldump备份数据时报错

匿名 (未验证) 提交于 2019-12-02 22:06:11
环境;
MySQL 版本 5.6.28


问题:
执行mysqldump出现以下报错,小白当时执行mysqldump备份时,是执行一次报一个错
1、mysqldump: Got error: 1146: Table 'mysql.innodb_index_stats' doesn't exist when using LOCK TABLES
2、mysqldump: Got error: 1146: Table 'mysql.innodb_table_stats' doesn't exist when using LOCK TABLES
3、mysqldump: Got error: 1146: Table 'mysql.slave_master_info' doesn't exist when using LOCK TABLES
4、mysqldump: Got error: 1146: Table 'mysql.slave_relay_log_info' doesn't exist when using LOCK TABLES
5、mysqldump: Got error: 1146: Table 'mysql.slave_worker_info' doesn't exist when using LOCK TABLES


解决方式:
1、删除上述系统表,
mysql> drop table mysql.innodb_index_stats;
mysql> drop table mysql.innodb_table_stats;
mysql> drop table mysql.slave_master_info;
mysql> drop table mysql.slave_relay_log_info;
mysql> drop table mysql.slave_worker_info;
可能报如下错误:
mysql> drop table mysql.innodb_index_stats;
ERROR 1051 (42S02): Unknown table 'mysql.innodb_index_stats'
这时使用下面2的删除方式


2、删除数据库mysql下相关的.frm .ibd文件,重启数据库
[root@test mysql]# rm -rf innodb_index_stats.*
[root@test mysql]# rm -rf innodb_table_stats.*
[root@test mysql]# rm -rf slave_master_info.*
[root@test mysql]# rm -rf slave_relay_log_info*
[root@test mysql]# rm -rf slave_worker_info*
[root@test mysql]# systemctl restart mysqld


3、登录数据库,重新创建上述系统表(复制下面相应的代码创建相应的表)
CREATE TABLE `innodb_index_stats` (







































































4、如果数据库有master-slave主备架构,恢复上诉表后,Slave启动报错,解决方法请百度
......


原文:http://blog.51cto.com/3332935/2141635

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!