By ymisgp
Recently I have purchased vps and after installing a website on wordpress frequenly I am getting an error about mysql database connection error. Each and every time I need to reboot my server, this is not feasible.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
The most common reason for this issue is that your MySQL process is exhausting the RAM your droplet has available. This then causes the service to crash. There are three steps you can take to resolve this:
1.) Set up a swap file on your droplet. This should prevent the crashes. 2.) Upgrade to a larger droplet with more RAM available. 3.) Optimize your MySQL and other services.
@ryanpq why does this seem to be a continuous problem for wordpress installs on DO? I haven’t seen this issue across other hosts
@ryanpq I just enabled a swapfile on one of my droplets. Since the error seems to occur randomly (not at times of high load) I’m not sure if doing this made a difference or not. Is there a way to stress test the effectiveness of an enabled swapfile? Thanks
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.