今天做测试时,查看错误日志发现有报错

2014-02-08 09:55:33 16545 [Warning] InnoDB: Cannot open table bit/inside_log 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-02-08 09:55:33 16545 [ERROR] Failed to open table bit/inside_parameters#P#p201311.

2014-02-08 09:55:33 16545 [Warning] InnoDB: Cannot open table bit/inside_parameters#P#p201311 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-02-08 09:55:33 b6cc0b70 InnoDB: Error: Table "mysql"."innodb_table_stats" not found.

原因是:innodb在.frm中存放了表的信息,但是同时也在数据字典中存放有表信息

此时可能是直接操作了数据文件而数据字典没来得及更新服务器便挂掉了导致不一致

drop table inside_parameters;

更新数据字典,同时会自动删除数据文件

2014-02-08 10:05:56 16545 [Warning] InnoDB: Cannot open table bit/inside_parameters#P#p201311 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-02-08 10:06:05 b6cc0b70 InnoDB: Error: table `bit`.`inside_parameters` /* Partition `p201311` */ does not exist in the InnoDB internal

InnoDB: data dictionary though MySQL is trying to drop it.

InnoDB: Have you copied the .frm file of the table to the

InnoDB: MySQL database directory from another database?

InnoDB: You can look for further help from

InnoDB: http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html

2014-02-08 10:06:05 b6cc0b70 InnoDB: Error: table `bit`.`inside_parameters` /* Partition `p201312` */ does not exist in the InnoDB internal

InnoDB: data dictionary though MySQL is trying to drop it.

InnoDB: Have you copied the .frm file of the table to the

InnoDB: MySQL database directory from another database?

InnoDB: You can look for further help from

InnoDB: http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html

2014-02-08 10:06:05 b6cc0b70 InnoDB: Error: table `bit`.`inside_parameters` /* Partition `p201401` */ does not exist in the InnoDB internal

InnoDB: data dictionary though MySQL is trying to drop it.

InnoDB: Have you copied the .frm file of the table to the

InnoDB: MySQL database directory from another database?

InnoDB: You can look for further help from

InnoDB: http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html

2014-02-08 10:06:05 b6cc0b70 InnoDB: Error: Table "mysql"."innodb_table_stats" not found.

2014-02-08 10:06:05 b6cc0b70 InnoDB: Error: Table "mysql"."innodb_table_stats" not found.

2014-02-08 10:06:05 b6cc0b70 InnoDB: Error: Table "mysql"."innodb_table_stats" not found.

2014-02-08 10:06:05 b6cc0b70 InnoDB: Error: Table "mysql"."innodb_table_stats" not found.

此时一直提示innodb_table_stats表不存在

查阅官方文档之后发现是5.6的新特性

在MySQL 5.6之前,如果关闭MySQL后删除ibdata1,再重新启动MySQL的时候ibdata1会被重新创建. 但从MySQL 5.6开始,这5个表不会被重建.即使删除了ibdata1,下面的10个文件仍然保留在/var/lib/mysql/mysql中(假如datadir = /var/lib/mysql/):

innodb_index_stats.frm

innodb_index_stats.ibd

innodb_table_stats.frm

innodb_table_stats.ibd

slave_master_info.frm

slave_master_info.ibd

slave_relay_log_info.frm

slave_relay_log_info.ibd

slave_worker_info.frm

slave_worker_info.ibd

在安装MySQL 5.6,使用mysql_install_db做初始化的时候需要指定–defaults-file选项,按照自定义的my.cnf里面的参数去初始化,而不能采用和5.5一样的方法删除之前的ibdata1文件后再重新生成新,因为MySQL 5.6在mysql系统库下引入上述的5个innodb表。否则启动mysqld的时候会出现我之前的警告信息

解决办法,从新库中导出这5个表再导入到现有库中

#!/bin/bash

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

OK!

mysql 5.6 ibdata1,5.6中删除ibdata1之后的报错相关推荐

  1. ibatis mysql 同时删多个表报错_MySQL中Multiple primary key defined报错的解决办法

    MySQL中Multiple primary key defined报错的解决办法 创建主键可以有两种方式: create table 表名( 字段名 类型, 字段名 类型, -- primary k ...

  2. Mysql存储过程老是报错_mysql中看看这个存储过程老是报错,该如何处理

    mysql中看看这个存储过程老是报错 我的mysql版本是5.5.21的,下面这个存储过程是需要更加另外3张表的数据来更新strategycontracttemp中数据,但是每次更新到中途报错,先代码 ...

  3. 遍历删除List中的元素,会报错? 用iterator.remove() 完美解决

     经常会碰到遍历集合,然后删除里面的对象报错, 纠结半天, 百度了一下,有大神说不能用for-each,  for , 只能用迭代器,真的吗?  我就删成功了呢,看代码,请大神们指正! publi ...

  4. mysql server 卸载不了_Mysql卸载问题Start Server卡住报错解决方法

    遇到的问题:安装mysql最后一步的时候 start server打叉并且报错. 问题截图: 报错代码: Beginning configuration step: Writing configura ...

  5. 在eclipse中导入工程后@Override报错

     在eclipse中导入工程后@Overide报错 到入工程后,所有的@Override都报如下错误: Multiple markers at this line  - The method ge ...

  6. windows python删除文件文件夹报错:PermissionError

    windows python删除文件文件夹报错:PermissionError 我遇到的问题 问题分析 定位 查明原因 解决方案 我遇到的问题 在windows中,使用shutil.rmtree(my ...

  7. 解决在eclipse中打开.yml文件老是报错的问题(粗暴有效)

    在eclipse中打开.yml文件老是报错 我在eclipse是装过eclipse的springboot插件的,可以支持yml文件, 但是有一点不舒服的地方在于,每次打开yml文件的时候编辑器就会报错 ...

  8. python字符串拼接数字_解决Python中字符串和数字拼接报错的方法

    解决Python中字符串和数字拼接报错的方法 前言 众所周知Python不像JS或者PHP这种弱类型语言里在字符串连接时会自动转换类型,如果直接将字符串和数字拼接会直接报错. 如以下的代码: # co ...

  9. IDEA中Dependencies红色波浪线报错的解决办法

    IDEA中Dependencies红色波浪线报错(缺少Dependency)的解决办法 记录一次,在pom文件导入依赖时,Maven里的Dependencies中有时候会有红色波浪线: com.ama ...

最新文章

  1. Understanding SOAP
  2. hdu2412 Party at Hali-Bula
  3. 云计算技术 — 云计算的未来
  4. shell中变量的取值与赋值
  5. python 后缀 .py .pyc .pyw .pyo .pyd的区别
  6. Windows 2008 R2阿里云安全基线检查
  7. MacOS中Elasticsearch的安装「借助Homebrew」
  8. oracle导出报错04063,Oracle EXP导出报错的解决方法
  9. Image合并添加文字内容
  10. MacOS Monterey 12.5 (21G72) OC 0.8.2 / Cl 5148 / PE 三分区原版黑苹果镜像
  11. python3的字符串操作
  12. 字节、十六进制字符串相互转换(asc2hex、hex2asc)
  13. 短视频制作团队的工作流程分为5个步骤
  14. windows xp apache php mysql_WindowsXP下安装和配置Apache2.2.22服务器+PHP5+Mysql5 wu金
  15. 置换流水车间调度问题的matlab求解,置换流水车间调度问题的几种智能算法
  16. python---exception handing and testing
  17. 【程序设计训练】棋盘
  18. 吴文俊:数学机械化——回顾与展望
  19. MySQL创建数据库和表格
  20. Cyclen-PEG-Bodipy;大环配体-聚乙二醇-氟化硼二吡咯;大环配体-PEG-Bodipy

热门文章

  1. mos管G级串联电阻作用、mos管选型、米勒平台详细讲解(待补充)
  2. 用matlab绘制lnx,matlab中自然对数 matlab怎么输入lnx
  3. 非线性优化--NLopt算法使用及C++实例
  4. Vue3 直接使用Vuex的mapState和mapGetters时报错的分析及解决方案
  5. 政治生态档案监督管理系统勾勒完整廉洁画像,推进廉政建设纵深发展
  6. mysql联合索引的使用
  7. 动态链接1 程序员的自我修养第七章笔记
  8. 爱情的几种形态(转贴)
  9. 学生档案的java界面_基于jsp的学生档案管理-JavaEE实现学生档案管理 - java项目源码...
  10. Titan线程隔离的验证