Database Error in my website help me resolve that?

Posted June 14, 2016 1.3k views

I have my website hosted on digitalocean per day this error happens error establishing database connection when i switch server off and again on error goes off is there any permanent solution say me please

1 comment
  • How can you possibly expect anyone to reply or even help you answer your question when you gave out no information at all. We don’t even know the system info, you didn’t use any tags and you provided no logs.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hi shyamsundarn,

Can you give us a bit more information here? Specifically:

  1. Size of the droplet
  2. The output of your mysql logs and/or output of dmesg & /var/log/messages

From here, we can hopefully help narrow down the issue. It could be that mysql is crashing/being killed off by OOMkiller, but without that information, it’ll be difficult to answer why this is happening.

As a sidenote, rather than going through the trouble of restarting the droplet, you may want to see if mysql is running:

service mysql status


netstat -ntlp | grep :3306

If it’s not, you should just be able to start it back up using

service mysql start