mysql 5.6 啟動失敗
log 檔案出現類似錯誤:
2013-06-04 09:16:46 1944 [Note] Plugin 'FEDERATED' is disabled.
2013-06-04 09:16:46 1944 [Note] InnoDB: The InnoDB memory heap is disabled
2013-06-04 09:16:46 1944 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2013-06-04 09:16:46 1944 [Note] InnoDB: Compressed tables use zlib 1.2.3
2013-06-04 09:16:46 1944 [Note] InnoDB: Not using CPU crc32 instructions
2013-06-04 09:16:46 1944 [Note] InnoDB: Initializing buffer pool, size = 256.0M
InnoDB: mmap(274726912 bytes) failed; errno 12
2013-06-04 09:16:46 1944 [ERROR] InnoDB: Cannot allocate memory for the buffer pool
2013-06-04 09:16:46 1944 [ERROR] Plugin 'InnoDB' init function returned error.
2013-06-04 09:16:46 1944 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2013-06-04 09:16:46 1944 [ERROR] Unknown/unsupported storage engine: InnoDB
2013-06-04 09:16:46 1944 [ERROR] Aborting
解決:
加 swap
dd if=/dev/zero of=/swapfile bs=1M count=1024 (新增 1G的 swap檔案)
mkswap /swapfile
swapon /swapfile
將 /swapfile swap swap defaults 0 0 加到 /etc/fstab 中
swap 相關命令:
swapon /swap_filename
swapon -a
swapoff /swap_filename
swapoff -a