vps mysql自動關閉

hikarusun發表於2014-05-21

買了個阿里雲的vps 裝了一個wordpress,mysql一直自動關閉,百思不得其解,只有搜尋

最後才發現是因為伺服器記憶體太小,畢竟是最便宜的才512m

 

-----------------------------------------------------

InnoDB: mmap(137363456 bytes) failed; errno 12

140521  1:53:50 InnoDB: Completed initialization of buffer pool

140521  1:53:50 InnoDB: Fatal error: cannot allocate memory for the buffer pool

140521  1:53:50 [ERROR] Plugin 'InnoDB' init function returned error.

140521  1:53:50 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.

140521  1:53:50 [ERROR] Unknown/unsupported storage engine: InnoDB

140521  1:53:50 [ERROR] Aborting

140521  1:53:50 [Note] /usr/sbin/mysqld: Shutdown complete

-----------------------------------------------------

沒有100M的空間給他使用,修改/etc/mysql/my.cnf 

增加

[mysqld]

innodb_buffer_pool_size=8MB

儲存後,再啟動mysql

mysql -u root -p

進入mysql

輸入

show variables like'%buffer_pool%';

看到

+------------------------------+---------+

| Variable_name                | Value   |

+------------------------------+---------+

| innodb_buffer_pool_instances | 1       |

| innodb_buffer_pool_size      | 8388608 |

+------------------------------+---------+

說明成功了,這樣就不會重啟了,話說512m的記憶體真可憐。

 

相關文章