数据库服务器安装的是5.6.39版本,源码安装完之后,启用的过程中在错误日志中发现如下记录
2018-11-29 18:05:19 7f05f8189700 InnoDB: Error: Table "mysql"."innodb_table_stats" not found.
2018-11-29 18:05:19 7f05f8189700 InnoDB: Error: Table "mysql"."innodb_table_stats" not found.
2018-11-29 18:13:10 7f05fa1fc700 InnoDB: Error: Table "mysql"."innodb_table_stats" not found.
2018-11-29 18:13:10 7f05fa1fc700 InnoDB: Recalculation of persistent statistics requested for table "openser"."power_managers_log" but the required persistent statistics storage is not present or is corrupted. Using transient stats instead.
2018-11-29 18:24:32 7f05fa1fc700 InnoDB: Error: Table "mysql"."innodb_table_stats" not found.
2018-11-29 18:24:32 7f05fa1fc700 InnoDB: Recalculation of persistent statistics requested for table "openser"."power_roles_authorities" but the required persistent statistics storage is not present or is corrupted. Using transient stats instead.
2018-11-29 18:24:51 7f05fa1fc700 InnoDB: Error: Table "mysql"."innodb_table_stats" not found.
原因分析
大概应该是由于创建表的引擎所导致;
解决措施
1.在数据库执行以下操作
drop table if exists innodb_index_stats;
drop table if exists innodb_table_stats;
drop table if exists slave_master_info;
drop table if exists slave_relay_log_info;
drop table if exists slave_worker_info;
2.去到对应的data目录下删除相应的ibd文件
cd /app/mysql/data/mysql
rm -f innodb_index_stats.ibd innodb_table_stats.ibd
rm -f slave*
3.重启数据库
/etc/init.d/mysqld restart
4.重建相关表即可