MySQL and Apache2 running together crashes MySQL
So this is a very odd issue that I can not seem to find an answer to anywhere else, but is causing me a huge problem.
So I am working on a website for a friend and I set him up with a digital ocean droplet running Wordpress (using the one click install). The server was fine for about a week, but then I would start to get the “Error establishing a database connection” message when trying to load the site. I eventually figured out that it was because MySQL was no longer running. I started the service again, thinking nothing of it and went about my day. I check back later, same error. I once again restart MySQL but watch htop this time. I see my RAM usage skyrocket, followed by my CUP usage, then it all goes back down and MySQL has crashed again. I ask another friend who has much more experience than me and he recommended rebuilding the droplet. Exported MySQL databases and backed up Wordpress files, rebuilt, imported settings, and was fine for a few days, but today I noticed the issue is happening again, but slightly different this time. Last time, MySQL lasted a good two minuted before crashing, now it seems to be about an hour between crashes, and in-between those times, CPU and RAM usage is normal and steady. I can guarantee you this isn’t a problem with the server being overloaded from a large amount of traffic, there are only about 10 people who know the site exists and there have only been about 24k requests since the site went active on May 5th (a majority of them being me). I have tried to solve this on my own but have had no luck at all, this is getting to be very frustrating.
To add some more information, before MySQL crashes, it starts creating new process that I can see from htop, but never ends them.
I can run Apache2 just fine without MySQL and I can run MySQL just fine without Apache2 and there is no issue, but when the two are running at the same time, MySQL crashes.
Here is my Apache2 config file. If there is anything else you need, let me know and I will get it for you as soon as I can.
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.×