If you think this is a MySQL problem, I would check is it up and running.
If you’re running Ubuntu 16.04 or newer, the following command is going to do the job:
- sudo systemctl status mysql
Observe for status, which should report
If it isn’t running, you can try starting it:
- sudo systemctl start mysql
Check the status again.
You can also check system logs, to try to find the root of the problem. System logs are located in the
/var/log/syslog file, so open it in a text editor:
- sudo nano /var/log/syslog
Observe for MySQL log. Also, if MySQL wasn’t running, you can check is there some
OOM killer or
Out of memory logs. If yes, you’re running out of memory for some reason, which causes MySQL to go down. This is quite a common reason why users have MySQL problems, so check it out.
If this doesn’t fix your problems, share the error your website is returning, maybe it can be helpful to debug the problem.