技术饭
Centos下MySQL出现Unknown/unsupported storage engine: InnoDB的解决方案
Centos下MySQL出现Unknown/unsupported storage engine: InnoDB的解决方案,今天同事公司服务器上的mysql启动不了了,弄了一早上头大,昨天还是可以正常运行的,今天怎么突然就奔了呢,在shell里登陆mysql提示不存在sock,也就是msyql没有启动,但却可以使用stop命令,后续查看err日志中发现了一些问题。
#################################################
130629 5:46:48 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
130629 5:46:48 InnoDB: Completed initialization of buffer pool
130629 5:46:48 InnoDB: Fatal error: cannot allocate memory for the buffer pool
130629 5:46:48 [ERROR] Plugin 'InnoDB' init function returned error.
130629 5:46:48 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
130629 5:46:48 [ERROR] Unknown/unsupported storage engine: InnoDB
130629 5:46:48 [ERROR] Aborting
#################################################
查看内存
$ free
total used free shared buffers cached
Mem: 608476 565044 43432 0 1284 53996
-/+ buffers/cache: 509764 98712
Swap: 0 0 0
好吧,明显的swap问题。适当增加swap,采用
$ sudo dd if=/dev/zero of=/swapfile bs=1M count=1024 #增加1G的SWAP进去
$ sudo mkswap /swapfile
$ sudo swapon /swapfile
$ free
total used free shared buffers cached
Mem: 608476 601432 7044 0 824 88752
-/+ buffers/cache: 511856 96620
Swap: 1048572 0 1048572
此处不建议将swapon 写到/etc/fstab这里,直接写到/etc.rc.local中更为稳妥
启动解决...
文明上网理性发言!