MySQL5.1升级到5.6服务后启动失败
时间:2019-08-20 17:58:32 来源:igfitidea点击:
下面是从5.1升级到MySQL server 5.6版本后,在MySQL错误日志文件中出现的下面错误。
2017-11-29 02:22:56 2175 [ERROR] InnoDB: auto-extending data file ./ibdata1 is of a different size 640 pages (rounded down to MB) than specified in the .cnf file: initial 768 pages, max 0 (relevant if non-zero) pages! 2017-11-29 02:22:56 2175 [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! 2017-11-29 02:22:56 2175 [ERROR] Plugin ‘InnoDB’ init function returned error. 2017-11-29 02:22:56 2175 [ERROR] Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed. 2017-11-29 02:22:56 2175 [ERROR] Unknown/unsupported storage engine: InnoDB 2017-11-29 02:22:56 2175 [ERROR] Aborting
无法打开或创建系统表空间。如果尝试向系统表空间添加新数据文件,但在这里失败了,那么现在应该在my.cnf中编辑innodb_data_file_path,并删除InnoDB在这个失败尝试中创建的新ibdata文件。InnoDB只写了那些满是零的文件,但还没有以任何方式使用它们。但是要小心:不要删除包含您宝贵数据的旧数据文件!
解决方案
要解决此问题,在 /etc/my.cnf中的 [mysqld]
配置块中添加下面这行:
innodb_data_file_path = ibdata1:10M:autoextend
现在重新启动mysql服务。
service mysqld restart