Home > Database > Mysql Tutorial > body text

vps mysql自动关闭

WBOY
Release: 2016-06-01 13:13:43
Original
1914 people have browsed it

mysql自动关闭

买了个阿里云的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的内存真可怜。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!