Question

Database Error in my website help me resolve that?

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

Subscribe
Share

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.


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

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

And/or

netstat -ntlp | grep :3306

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

service mysql start