首页
随机
最近更改
特殊页面
社群首页
参数设置
关于WHY42
免责声明
WHY42
搜索
用户菜单
登录
欢迎来到Riguz的小站!这是一个私人wiki,用来记录一些我的笔记。
查看“︁MySQL:低内存机器配置”︁的源代码
←
MySQL:低内存机器配置
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
这几天发现本网站老是连不上数据库,查看日志: <pre> 170110 8:29:52 InnoDB: Initializing buffer pool, size = 128.0M InnoDB: mmap(137756672 bytes) failed; errno 12 170110 8:29:52 InnoDB: Completed initialization of buffer pool 170110 8:29:52 InnoDB: Fatal error: cannot allocate memory for the buffer pool 170110 8:29:52 [ERROR] Plugin 'InnoDB' init function returned error. 170110 8:29:52 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 170110 8:29:52 [ERROR] mysqld: Out of memory (Needed 128917504 bytes) 170110 8:29:52 [ERROR] mysqld: Out of memory (Needed 96681984 bytes) 170110 8:29:52 [ERROR] mysqld: Out of memory (Needed 72499200 bytes) 170110 8:29:52 [Note] Plugin 'FEEDBACK' is disabled. 170110 8:29:52 [ERROR] Unknown/unsupported storage engine: InnoDB 170110 8:29:52 [ERROR] Aborting </pre> *http://serverfault.com/questions/564748/mysql-mariadb-crashes-frequently *https://mariadb.com/resources/blog/starting-mysql-low-memory-virtual-machines 正巧本人使用的就是AWS的免费EC2服务器,还有MariaDB。修改配置 <source lang="lua"> [mysqld] performance_schema = off </source> 另外查看EC-2没有设置swap,需要设置swap: <source lang="bash"> dd if=/dev/zero of=/swapfile bs=1M count=1024 mkswap /swapfile swapon /swapfile </source> 添加到/etc/fstab <pre> /swapfile swap swap defaults 0 0 </pre> 如果需要更改innodb_buffer_pool_size <source lang="lua"> [mysqld] innodb_buffer_pool_size=64M </source> [[Category:Database]]
返回
MySQL:低内存机器配置
。