300字范文,内容丰富有趣,生活中的好帮手!
300字范文 > Mysql重启服务Error: tablespace id is xx in the data dictionary问题

Mysql重启服务Error: tablespace id is xx in the data dictionary问题

时间:2021-08-01 14:34:56

相关推荐

Mysql重启服务Error: tablespace id is xx in the data dictionary问题

今天在进行同步线上数据到线下数据库时候,重启数据库失败,报错如下:

-06-10 15:48:14 38376 [Note] InnoDB: 128 rollback segment(s) are active.-06-10 15:48:14 38376 [Note] InnoDB: Waiting for purge to startInnoDB: Error: tablespace id is 4753 in the data dictionaryInnoDB: but in file ./mysql/innodb_index_stats.ibd it is 2!

翻译过来大概就是innodb_index_stats.ibd这个表的表空间id不一致的问题。

首先想想问题产生的原因,mysql的默认库mysql我用的是线下的数据,而mysql里面包括这张表,而其他数据库的数据都是线上的,这个索引表用于记录索引的状态信息,于是就产生了这个问题。

解决办法:innodb_index_stats.ibd这个表也使用线上的数据就可以了。。

然后重启就成功了:

mysqld_safe --defaults-file=/data/conf/f &

或者你也可以先删除表空间结构:

ALTER TABLE table DISCARD TABLESPACE;

然后再导入一遍表结构:

ALTER TABLE table IMPORT TABLESPACE;

问题也可以解决

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。