The Auto-extending innodb_system 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!

在CentOS6.4 Linux上面安装MySQL5.7.10版本的数据库,在启动服务时抛出如下错误: 2017-07-09T07:26:50.601399Z 0 [ERROR] InnoDB: The Auto-extending innodb_system 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!

在CentOS6.4 Linux上面安装MySQL5.7.10版本的数据库,在启动服务时抛出如下错误:

2017-07-09T07:26:50.601399Z 0 [ERROR] InnoDB: The Auto-extending innodb_system 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-07-09T07:26:50.601441Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2017-07-09T07:26:51.216779Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2017-07-09T07:26:51.216882Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2017-07-09T07:26:51.216922Z 0 [ERROR] Failed to initialize plugins.
2017-07-09T07:26:51.216953Z 0 [ERROR] Aborting

解决办法:

修改/etc/my.cnf配置文件,添加如下配置:

innodb_data_file_path = ibdata1:10M:autoextend

再次,尝试启动MySQL服务器,还是失败。我们可以去查看/var/log/mysqld.log日志文件,存在如下错误信息:

2017-07-09T07:30:03.523929Z 0 [ERROR] Fatal error: mysql.user table is damaged. Please run mysql_upgrade.
2017-07-09T07:30:03.524296Z 0 [ERROR] Aborting

去删除/var/lib/mysql目录下面所有文件,如下:

[root@learn mysql]# ll
total 174108
-rw-r-----. 1 mysql mysql       56 Jul  9 15:36 auto.cnf
-rw-r-----. 1 mysql mysql      346 Jul  9 15:41 ib_buffer_pool
-rw-r-----. 1 mysql mysql 77594624 Jul  9 15:41 ibdata1
-rw-r-----. 1 mysql mysql 50331648 Jul  9 15:41 ib_logfile0
-rw-r-----. 1 mysql mysql 50331648 Jul  9 15:36 ib_logfile1
drwxr-x---. 2 mysql mysql     4096 Jul  9 15:36 mysql
drwxr-x---. 2 mysql mysql     4096 Jul  9 15:36 performance_schema
drwxr-x---. 2 mysql mysql    12288 Jul  9 15:36 sys
[root@learn mysql]# rm -fr *

然后再次去初始化mysql,如下:

[root@learn mysql]# mysqld --initialize --user=mysql

启动mysql,如下:

[root@learn mysql]# service mysqld restart
Stopping mysqld:                                           [  OK  ]
Starting mysqld:                                           [  OK  ]
[root@learn mysql]#

到这里就成功了!不一定能够帮助到你,但是能给你提供参考。谢谢支持!

业精于勤,荒于嬉。——韩愈《进学解》
0 不喜欢
说说我的看法 -
全部评论(
没有评论
关于
本网站专注于 Java、数据库(MySQL、Oracle)、Linux、软件架构及大数据等多领域技术知识分享。涵盖丰富的原创与精选技术文章,助力技术传播与交流。无论是技术新手渴望入门,还是资深开发者寻求进阶,这里都能为您提供深度见解与实用经验,让复杂编码变得轻松易懂,携手共赴技术提升新高度。如有侵权,请来信告知:hxstrive@outlook.com
其他应用
公众号