: Error:
Table "mysql"."innodb_table_stats"
not found. InnoDB: Recalculation
of persistent statistics requested for table "mydatabase"."mytable"
but the required persistent statistics storage is not present or is corrupted.
Using transient stats instead.
这个错误一般是在手动删除了mysql下的ibdata1文件导致的,在重新导入数据库后,mysql能正常运行且不影响业务,但是在错误日志中会看到以上错误报告,虽然不影响业务但毕竟是个错误信息就需要解决掉。
-
drop these tables from mysql: innodb_index_stats innodb_table_stats slave_master_info slave_relay_log_info slave_worker_info
-
delete all .frm & .ibd of the tables above.
-
run this file to recreate the tables above (source five-tables.sql).
-
restart mysqld.
这是stackoverflow上提供的解决方案
首先删除mysql库(注意这里是指mysql下一个默认存在的库)下 innodb_index_stats innodb_table_stats slave_master_info slave_relay_log_info slave_worker_info 这五个表,同时删除其对应的 .frm 和 .ibd的文件,然后再重新创建刚删除的五个表,可以使用提供的sql文件来创建,最后重启就ok了。
附上 stackoverflow 上的原文链接 https://stackoverflow.com/questions/15767652/mysql-error-table-mysql-innodb-table-stats-not-found