The MySQL error log shows:
Innodb:mmap (137363456 bytes) failed; errno 12
2016-03-01 01:38:42 13064 [ERROR] Innodb:cannot allocate memory for the buffer pool
2016-03-01 01:38:42 13064 [ERROR] Plugin ' InnoDB ' init function returned ERROR.
2016-03-01 01:38:42 13064 [ERROR] Plugin ' InnoDB ' registration as a STORAGE ENGINE failed.
2016-03-01 01:38:42 13064 [ERROR] unknown/unsupported storage Engine:innodb
2016-03-01 01:38:42 13064 [ERROR] Aborting
This is usually caused by low system memory, the solution is to upgrade the system memory or add swap;
Workaround:
1) Add the following sentence to the/ETC/MYSQL/MY.CNF mysqld:
innodb_buffer_pool_size = 64M
Also set the swap partition, because my VPS is no swap partition, through fdisk -l and 1mount do not see the swap information, need to manually add.
2) steps to add a swap partition:
2.1) dd if=/dev/zero of=/swapfile bs=1M count=10242.2) mkswap /swapfile2.3) swapon /swapfile2.4) 添加这行: /swapfile swap swap defaults 0 0 到 /etc/fstab
Now that you have set up the swap partition and restarted MySQL, look for a follow-up check to see if it will happen.
Linux set virtual memory (swap) to troubleshoot MySQL hangs due to insufficient memory