1.在安裝mysql 5.6.15時,安裝完成後,後臺日誌報以下警告信息:html
2014-01-08 13:47:34 22946 [Warning] InnoDB: Cannot open table mysql/slave_master_info from the internal data dictionary of InnoDB though the .frm file for the table exists. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html for how you can resolve the problem.mysql
2014-01-08 13:47:34 22946 [Warning] Info table is not ready to be used. Table 'mysql.slave_master_info' cannot be opened. 2014-01-08 13:47:34 22946 [Warning] InnoDB: Cannot open table mysql/slave_worker_info from the internal data dictionary of InnoDB though the .frm file for the table exists. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html for how you can resolve the problem. 2014-01-08 13:47:34 22946 [Warning] InnoDB: Cannot open table mysql/slave_relay_log_info from the internal data dictionary of InnoDB though the .frm file for the table exists. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html for how you can resolve the problem. 2014-01-08 13:47:34 22946 [Warning] Info table is not ready to be used. Table 'mysql.slave_relay_log_info' cannot be opened. ....... 2014-01-08 13:49:33 22946 [Warning] InnoDB: Cannot open table mysql/innodb_index_stats from the internal data dictionary of InnoDB though the .frm file for the table exists. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html for how you can resolve the problem. 2014-01-08 13:49:49 7f3ae82a5700 InnoDB: Error: table mysql
.innodb_index_stats
does not exist in the InnoDB internalsql
2.問題產生緣由:具體緣由目前不詳,網上查找到的資料:數據庫打開這幾張表的默認引擎爲MyISAM,可是這幾張表在建表時的引擎爲INNODB數據庫
可是能肯定的,這幾張表確實是在mysql5.6中新入的日誌
innodb_index_stats,code
innodb_tables_stats,server
slave_master_info,htm
slave_relay_log_info,get
slave_worker_infoit
3.解決方法:
(1) 登陸數據庫,進入mysql庫,執行以下SQL刪除5張表
記住,必定要是drop table if exists
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;
以下是執行的結果,忽略你看到的Warning信息
admin@localhost : mysql 02:12:26> drop table if exists innodb_index_stats;
Query OK, 0 rows affected, 1 warning (0.00 sec)
Warning (Code 155): Table 'mysql.innodb_index_stats' doesn't exist admin@localhost : mysql 02:12:26> drop table if exists innodb_table_stats; Query OK, 0 rows affected, 1 warning (0.00 sec)
Warning (Code 155): Table 'mysql.innodb_table_stats' doesn't exist admin@localhost : mysql 02:12:26> drop table if exists slave_master_info; Query OK, 0 rows affected, 1 warning (0.00 sec)
Warning (Code 155): Table 'mysql.slave_master_info' doesn't exist admin@localhost : mysql 02:12:27> drop table if exists slave_relay_log_info; Query OK, 0 rows affected, 1 warning (0.00 sec)
Warning (Code 155): Table 'mysql.slave_relay_log_info' doesn't exist admin@localhost : mysql 02:12:27> drop table if exists slave_worker_info; Query OK, 0 rows affected, 1 warning (0.00 sec) Warning (Code 155): Table 'mysql.slave_worker_info' doesn't exist
執行完後,能夠用show tables查看一下,看錶的數據是否已經比刪除以前減小了,若是減小了,說明你成功了!
(2)面這一部操做完成後,中止數據庫,並進入到數據庫數據文件所在目錄,刪除表面5個表所對應的idb文件,以下所示:
[mysql@test /data/mysqldata3/mydata/mysql]ls *.ibd innodb_index_stats.ibd innodb_table_stats.ibd slave_master_info.ibd slave_relay_log_info.ibd slave_worker_info.ibd [mysql@teset /data/mysqldata3/mydata/mysql]rm -f *.ibd
(3) 從新啓動數據庫,進入到mysql庫,重建上面被刪除的表結構:
數據庫的建設表腳本在mysql軟件的安裝目錄的share目錄下,個人mysql軟件的安裝路徑爲/usr/test/mysql
admin@localhost : (none) 02:23:03> use mysql Database changed
以下是執行建表腳本前表的數量:
admin@localhost : mysql 02:23:48> source /usr/test/mysql/share/mysql_system_tables.sql
admin@localhost : mysql 02:23:50> show tables; +---------------------------+ | Tables_in_mysql | +---------------------------+ | columns_priv | | db | | event | | func | | general_log | | help_category | | help_keyword | | help_relation | | help_topic | | ndb_binlog_index | | plugin | | proc | | procs_priv | | proxies_priv | | servers | | slow_log | | tables_priv | | time_zone | | time_zone_leap_second | | time_zone_name | | time_zone_transition | | time_zone_transition_type | | user | +---------------------------+ 23 rows in set (0.00 sec)
以下爲執行建表腳本後,表的數量
admin@localhost : mysql 02:23:46> show tables; +---------------------------+ | 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)
(4) 用show create table命令查看錶時,也完正常,後臺日誌中也再也不報與上面提到的5張表相關的錯誤,到此,問題所有解決!