Database Error in my website help me resolve that?

June 14, 2016 158 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.

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
Have another answer? Share your knowledge.