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张表相关的错误,到此,问题所有解决!