在重装MySQL5.6.25安装到进行配置的时候,一直在等待服务的启动。如果手动在系统服务启动会提示1067错误,这个错误在网上很常见,然而我试过了很多方法均无法解决。
于是看ProgramData\MySQL Server 5.6\data下的 ***.err 错误日志,看出错的部分:
2015-06-04 13:08:19 5200 [Warning] InnoDB: Doublewrite does not have page_no=0 of space: 0
2015-06-04 13:08:19 5200 [ERROR] InnoDB: space header page consists of zero bytes in data file .\ibdata1
2015-06-04 13:08:19 5200 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!
2015-06-04 13:08:19 5200 [ERROR] Plugin ‘InnoDB‘ init function returned error.
2015-06-04 13:08:19 5200 [ERROR] Plugin ‘InnoDB‘ registration as a STORAGE ENGINE failed.
2015-06-04 13:08:19 5200 [ERROR] Unknown/unsupported storage engine: INNODB
2015-06-04 13:08:19 5200 [ERROR] Aborting
看样子像是文件内容出错,删除 ProgramData\MySQL Server 5.6\data 下的 ib_logfile0、ib_logfile1、ibdata1 三个文件。重新启动MySQL服务,依然1067错误。继续看错误日志:
2015-06-04 13:11:00 be8 InnoDB: Operating system error number 87 in a file operation.
InnoDB: Some operating system error numbers are described at
InnoDB: http://dev.mysql.com/doc/refman/5.6/en/operating-system-error-codes.html
2015-06-04 13:11:00 5932 [ERROR] InnoDB: File .\ib_logfile101: ‘aio write‘ returned OS error 187. Cannot continue operation
于是在 ProgramData\MySQL Server 5.6的my.ini文件最后一行加上
innodb_flush_method=normal
问题得以解决。(如果还不行,就再删除那三个文件再启动)