Glam Prestige Journal

Bright entertainment trends with youth appeal.

lately I have been loading my website, and almost every time I do (once or twice a day) the message: "Error establishing a database connection". I have resolved it temporarily by stopping and starting mysql using 'service mysql stop' then 'service mysql start'.

My website works after I send these commands over ssh.

However this is recurring, every time I load my website, say the next day, I get the same error.

My server is running Ubuntu 14.04 (DigitalOcean) and has mysql, phpmyadmin and wordpress installed.

Can anyone give my some advice on how to resolve this?

1 Answer

Anything in the log file?

less /var/log/messages
less /var/log/syslog

As for me, first time over at Digital Ocean I burned myself not setting up a swapfile and with the 500mb RAM I quickly learned that this was needed. (e.g. services/server crashed) Maybe you have more memory available, still worth checking.

You can check with:

sudo swapon -s

If this is the issue, please see their howto on to do this: How-to-add-swap-on-ubuntu-14-04

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy