InnoDB: space header page consists of zero bytes in tablespace ./mysql/iyikcr32.ibd (table mysql/iyi

今天第一天上班,就遇到了一个非常棘手的问题:InnoDB: space header page consists of zero bytes in tablespace ./mysql/iyikcr32.ibd (table mysql/iyikcr32)。

简单翻译一下报错信息:特定表空间大小为空。


根据提示的信息,第一步:排查服务器的资源是否充足(重点是内存资源和磁盘资源)

centOS6.5 查看内存大小:

#free -m

InnoDB: space header page consists of zero bytes in tablespace ./mysql/iyikcr32.ibd (table mysql/iyi_第1张图片

从上述配置信息,服务器的内存资源是十分充足的,资源问题排除。


第二步:网上百度和google 看到一些朋友,遇到了类型的问题,我查考了一下他们的解决办法(重点是设置:Innodb 初始化参数)

centOS6.5 修改mysql 配置参数

# vi /etc/my.cnf   

innodb_buffer_pool_size = 256M  
innodb_log_file_size    = 256M  
innodb_thread_concurrency   = 16  
innodb_flush_log_at_trx_commit = 2  
centOS6.5 重新启动mysql

# /etc/init.d/mysql restart


但是我重新启动MySQL时,还是提示相同的错误信息,一时陷入沉思当中。

......

经过一段时间的冷静,我查看了一下mysql 的错误日志信息(/var/log/mysql/error.log[这是我在mysql 配置文件中,指定mysql 操作日志文件位置]),错误日志如下:

2016-06-27 10:52:50 8897 [Note] InnoDB: Database was not shutdown normally!
2016-06-27 10:52:50 8897 [Note] InnoDB: Starting crash recovery.
2016-06-27 10:52:50 8897 [Note] InnoDB: Reading tablespace information from the .ibd files...
2016-06-27 10:52:50 8897 [ERROR] InnoDB: space header page consists of zero bytes in tablespace ./mysql/iyikcr32.ibd (table mysql/iyikcr32)
2016-06-27 10:52:50 8897 [Note] InnoDB: Page size:1024 Pages to analyze:64
2016-06-27 10:52:50 8897 [Note] InnoDB: Page size: 1024, Possible space_id count:0
2016-06-27 10:52:50 8897 [Note] InnoDB: Page size:2048 Pages to analyze:32
2016-06-27 10:52:50 8897 [Note] InnoDB: Page size: 2048, Possible space_id count:0
2016-06-27 10:52:50 8897 [Note] InnoDB: Page size:4096 Pages to analyze:16
2016-06-27 10:52:50 8897 [Note] InnoDB: Page size: 4096, Possible space_id count:0
2016-06-27 10:52:50 8897 [Note] InnoDB: Page size:8192 Pages to analyze:8
2016-06-27 10:52:50 8897 [Note] InnoDB: Page size: 8192, Possible space_id count:0
2016-06-27 10:52:50 8897 [Note] InnoDB: Page size:16384 Pages to analyze:4
2016-06-27 10:52:50 8897 [Note] InnoDB: Page size: 16384, Possible space_id count:0
2016-06-27 10:52:50 7f33dfffb720  InnoDB: Operating system error number 2 in a file operation.

重点是提示错误表空间所在的位置,(mysql/iyikcr32),我心想,老子干脆一不做二不休,直接干掉这个狗粮养的破文件。

温馨提示:删除数据库相关数据文件,请到用户所配置的数据文件夹进行相关的删除操作(我配置的数据库存储文件路径是:/db/mysql/data).

centOS6.5 先切换到指定文件路径

# cd /db/mysql/data

# ls -a

InnoDB: space header page consists of zero bytes in tablespace ./mysql/iyikcr32.ibd (table mysql/iyi_第2张图片

干掉这个破文件

#rm -rf njwxyi32.ibd

重新启动mysql

#service mysql restart



哎,总算搞定它了。



你可能感兴趣的:(MySQL)