mariadb异常 mysqld: Out of memory Centos 创建swap分区解决
最近几天,服务器异常,常报500错误,数据库无法连接,网站不能访问。查看mariadb日志,打开: /var/log/mariadb/mariadb.log
160915 19:44:22 InnoDB: Fatal error: cannot allocate memory for the buffer pool 160915 19:44:22 [ERROR] Plugin 'InnoDB' init function returned error. 160915 19:44:22 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 160915 19:44:22 [ERROR] mysqld: Out of memory (Needed 128917504 bytes) 160915 19:44:22 [ERROR] mysqld: Out of memory (Needed 96681984 bytes) 160915 19:44:22 [ERROR] mysqld: Out of memory (Needed 72499200 bytes)
是内存不够,购买是阿里云主机1G内存,不够用了,可以创建swap分区来解决。
创建4g swap分区
dd if=/dev/zero of=/var/swap bs=1024 count=4194304 mkswap /var/swap
激活swap分区
swapon /var/swap
设置自动挂载
vi /etc/fstab /var/swap swap swap defaults 0 0
重启服务器
shutdown -r now
查看内存使用状态
free -m
total used free shared buff/cache available Mem: 991 347 261 40 382 382 Swap: 4096 0 4096
创建swap分区成功,再没因内存不够而maridb自动关闭了。
更多阅读
- 宇秀下拉 2026-6-25日下拉更新案例
- electron 报错 Error: Electron failed to install correctly, please delete node_modulees/electron and try installing again
- 小鸿百度站长收录批量提交工具
- java实现百度站长平台网页链接批量提交(附源代码)
- 百度冰桶算法4.5更新:发力打击Landing Page恶劣广告行为
- Ubuntu 14.04下解决 Gtk-WARNING **: 无法在模块路径中找到主题引擎 pixmap
- 助力seo—百度ping自动提交当前网页给百度搜索引擎 php实现 附代码
- 岚鸿搜索引擎下拉及相关搜索词挖掘系统发布
- java 获取windows系统硬盘分区 盘符 源代码
- nginx 下 drupal 8升级提示 update.php/selection not found

qq:1535604235


QQ
微信
商店