I'm deploying a site to a Digital Ocean Ubuntu 16 server. I'm using PHP 5.6, but otherwise using the default versions of the necessary database software. The site functions; however, I frequently have database related errors, specifically, the following one:
PDOException: SQLSTATE[HY000]  Connection refused in lock_may_be_available() (line 167 of /var/www/html/phisigmarho.org/includes/lock.inc).
I usually get that error, but I also get "the website experienced an error" errors when I to do anything database or process intensive (updating modules through the UI, etc). I'm relatively new server administration, so I'm not sure what could be wrong or which logs I should be looking at for clues to what's wrong. For the moment, restarting MySQL from the terminal is letting me move forward with setting up the site, but I can't let anyone use the site the way that it is now.
How do I figure out why MySQL keeps going away?