dongqiang4819 2016-02-13 13:17
浏览 129

建立数据库连接wordpress网站时出错

I created a website with Wordpress.

My problem is that time by time appears an error that gives this message Error establishing a database connection.

I can fix this error when I login to the server and type this command: sudo service mysql restart.

I want to know if someone have an idea why this is happening?

Edit ---- Here is the result that i get after i run this command df -h :

Server space

Results after htop command : enter image description here

  • 写回答

1条回答 默认 最新

  • dongzhina7098 2016-02-13 13:24
    关注

    SSH into your server and run the following:

    This will tell you how much free space you have in memory and disk.

    df -h
    

    I've found that if I run out of disk my server reboots. You might also find that your server provider has had an outage, which is more common then you'd realise.

    To increase swap disk space (temporary ram), follow this tutorial: https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04

    If you want to automatically launch the mysql process on boot you can follow this guide:

    https://www.digitalocean.com/community/tutorials/how-to-configure-a-linux-service-to-start-automatically-after-a-crash-or-reboot-part-1-practical-examples

    It depends on your operating system as to how you relaunch the service. It differs on Ubuntu.

    --

    Edit It looks like you have enough disk space on the machine to operate normally.

    You can check the amount of ram free by using this command:

    htop
    

    Edit2 Looks like you also have enough ram. The server has been up for 32 days however. I would recommend checking out how to restart your mysql instance when the server restarts and then reboot the server to check if your database comes back online.

    评论

报告相同问题?

悬赏问题

  • ¥50 comsol稳态求解器 找不到解,奇异矩阵有1个空方程返回的解不收敛。没有返回所有参数步长;pid控制
  • ¥15 怎么让wx群机器人发送音乐
  • ¥15 fesafe材料库问题
  • ¥35 beats蓝牙耳机怎么查看日志
  • ¥15 Fluent齿轮搅油
  • ¥15 八爪鱼爬数据为什么自己停了
  • ¥15 交替优化波束形成和ris反射角使保密速率最大化
  • ¥15 树莓派与pix飞控通信
  • ¥15 自动转发微信群信息到另外一个微信群
  • ¥15 outlook无法配置成功