mysqldump error

mysqldump备份有时报错了,内容如下:

mysql@localhost mysql]$ mysqldump --single-transaction -A -uroot -proot123 --master-data=2 > /u01/backup/testbk.sql
Warning: Using a password on the command line interface can be insecure.
Error: Couldn't read status information for table slave_master_info ()
mysqldump: Couldn't execute 'show create table `slave_master_info`': Table 'mysql.slave_master_info' doesn't exist (1146)

错误提示有innodb_index_stats,innodb_table_stats,slave_master_info,slave_relay_log_info,slave_worker_info等几个
使用select语句进行查询时,也会提示这些表不存在

最终解决方法是:删除错误的表后重建

1.查询不可使用的表
show create table mysql.innodb_index_stats;
show create table mysql.innodb_table_stats;
show create table mysql.slave_master_info;
show create table mysql.slave_relay_log_info;
show create table mysql.slave_worker_info;

2.删除上述5张表或有错误的表
drop table mysql.innodb_index_stats;
drop table mysql.innodb_table_stats;
drop table mysql.slave_master_info;
drop table mysql.slave_relay_log_info;
drop table mysql.slave_worker_info;

3.进入data/mysql相应文件夹找到关于5张表的数据文件(.frm,.ibd)并删除
rm -rf innodb_index_stats.*
rm -rf innodb_table_stats.*
rm -rf slave_master_info.*
rm -rf slave_relay_log_info.*
rm -rf slave_worker_info.*

4. 查找表结构
去找$MYSQL_HOME/share/mysql_system_tables.sql,分别search到每一表的建表语句,然后重建设;

此条目发表在db分类目录,贴了, 标签。将固定链接加入收藏夹。