1779986 2015-10-06 00:06:37 7f5215214700 InnoDB: Error: Table "mysql"."innodb_table_stats" not found. 1779987 2015-10-06 00:06:37 7f5215214700 InnoDB: Recalculation of persistent statistics requested for table "xxxx"."xxxxxx" but the required persistent statistics storage is not present or is corrupted. Using transient stats instead.
mysql> select table_name from information_schema.tables where table_schema='mysql' and engine='InnoDB'; +----------------------+ | table_name | +----------------------+ | innodb_index_stats | | innodb_table_stats | | slave_master_info | | slave_relay_log_info | | slave_worker_info | +----------------------+ 5 rows in set (0.00 sec)
MySQL 5.5 系统表 +---------------------------+ | columns_priv | | db | | event | | func | | help_category | | help_keyword | | help_relation | | help_topic | | host | | ndb_binlog_index | | plugin | | proc | | procs_priv | | proxies_priv | | servers | | tables_priv | | time_zone | | time_zone_leap_second | | time_zone_name | | time_zone_transition | | time_zone_transition_type | | user | +---------------------------+ 22 rows in set (0.00 sec)
MySQL 5.6 系统表 +---------------------------+ | Tables_in_mysql | +---------------------------+ | columns_priv | | db | | event | | func | | general_log | | help_category | | help_keyword | | help_relation | | help_topic | | innodb_index_stats | | innodb_table_stats | | ndb_binlog_index | | plugin | | proc | | procs_priv | | proxies_priv | | servers | | slave_master_info | | slave_relay_log_info | | slave_worker_info | | slow_log | | tables_priv | | time_zone | | time_zone_leap_second | | time_zone_name | | time_zone_transition | | time_zone_transition_type | | user | +---------------------------+ 28 rows in set (0.00 sec)由上述统计可以看到,在mysql5.6 中,除了增加了上述5张表,还添加了general_log 、slow_log 表,并且将5.5中的host表合到了5.6中的user表中。
#!/bin/sh TABLELIST="innodb_index_stats" TABLELIST="${TABLELIST} innodb_table_stats" TABLELIST="${TABLELIST} slave_master_info" TABLELIST="${TABLELIST} slave_relay_log_info" TABLELIST="${TABLELIST} slave_worker_info" mysqldump -uroot -p mysql ${TABLELIST} > mysql_innodb_tables.sql
# mysql -uroot -p mysql < mysql_innodb_tables.sql