667   MySQL

1, wordpress 博客报错,mariadb 数据库链接不上

Error Establishing a Database Connection

2,查看mariadb 数据库日志,内存不够用了

InnoDB: The InnoDB memory heap is disabled

3,free -m 查看内存信息时,发现 swap 分区大小为 0

4,那就新建一个 swap 文件吧

  # 1048576 = 1024 * 1024
  dd if=/dev/zero of=/swapfile bs=1024 count=1048576

5,配置swapfile

  mkswap /swapfile

6,立即生效

 swapon /swapfile

7,重启生效

 /swapfile       swap    swap defaults   0 0



Leave a Reply

Your email address will not be published. Required fields are marked *