MySQL数据库崩溃,错误日志:[ERROR] Plugin ‘InnoDB’ init function returned error解决办法

系统环境:
CENTOS7, XAMPP

找到日志位置:
/opt/lampp/var/mysql/instance-7srte5br.err

错误日志如下:

2018-12-19 19:02:20 140493164005184 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2018-12-19 19:02:20 140493164005184 [Note] InnoDB: The InnoDB memory heap is disabled
2018-12-19 19:02:20 140493164005184 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-12-19 19:02:20 140493164005184 [Note] InnoDB: GCC builtin __sync_synchronize() is used for memory barrier
2018-12-19 19:02:20 140493164005184 [Note] InnoDB: Compressed tables use zlib 1.2.8
2018-12-19 19:02:20 140493164005184 [Note] InnoDB: Using SSE crc32 instructions
2018-12-19 19:02:20 140493164005184 [Note] InnoDB: Initializing buffer pool, size = 32.0M
2018-12-19 19:02:20 140493164005184 [Note] InnoDB: Completed initialization of buffer pool
2018-12-19 19:02:20 140493164005184 [Note] InnoDB: Highest supported file format is Barracuda.
2018-12-19 19:02:20 140493164005184 [Note] InnoDB: Starting crash recovery from checkpoint LSN=539566569
2018-12-19 19:02:20 140493164005184 [Note] InnoDB: Restoring possible half-written data pages from the doublewrite buffer...
InnoDB: Set innodb_force_recovery to ignore this error.
2018-12-19 19:02:20 140493164005184 [ERROR] Plugin 'InnoDB' init function returned error.
2018-12-19 19:02:20 140493164005184 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2018-12-19 19:02:20 140493164005184 [Note] Plugin 'FEEDBACK' is disabled.
2018-12-19 19:02:20 140493164005184 [ERROR] Unknown/unsupported storage engine: InnoDB
2018-12-19 19:02:20 140493164005184 [ERROR] Aborting

产生原因:
这和my.cnf配置有关,常常是服务器配置太低,流量太大导致mysql异常

解决办法:
1,先配置my.cnf文件如下:

# The MySQL server
[mysqld]
key_buffer = 256M
max_allowed_packet = 64M
table_open_cache = 64
sort_buffer_size = 2M
net_buffer_length = 16K
read_buffer_size = 4M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 64M

# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
innodb_buffer_pool_size = 1024M

innodb_log_file_size = 10M
innodb_log_buffer_size = 16M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 100

[isamchk]
key_buffer = 256M
sort_buffer_size = 20M
read_buffer = 4M
write_buffer = 4M

[myisamchk]
key_buffer = 256M
sort_buffer_size = 20M
read_buffer = 4M
write_buffer = 4M

2,停止MYSQL服务,并删除
/opt/lampp/var/mysql/ib_logfile0
/opt/lampp/var/mysql/ib_logfile1
这两个文件

3,重启MYSQL服务即可

4,其他注意事项:可以备份需要删除的文件,再恢复时注意文件权限

郑重声明:

1 本资源来源于互联网,资源的版权归资源原作者所持有,受《中华人民共和国著作权法》等相关法律保护。

2 由于无法和原作者取得联系,所以上传的部分资源无法先通过原作者的同意就分享给大家了,如本资源侵犯了您(原作者)的权益,请联系我们(手机号15240025146),我们会立马删除您的资源,并向您表达诚挚的歉意!

3 本站是一个公益型网站,分享资源的目的在于传播知识,分享知识,收取一点点打赏的辛苦费是用于网站的日常运营开支,并非用于商业用途。

4 本站资源只提供学习和参考研究使用,使用过后请在第一时间内删除。本站不承担资源被单位或个人商用带来的法律责任。

发表评论