How to fix error establishing a database connection | DigitalOcean
Your website facing errors on “Error establishing a database connection” message ?
Is your site was previously running fine and you haven’t been messing with the database settings within wordpress, suddenly this error is most likely just a result of your server having crashed.
if yes, then you are in the right platform. There are many reasons for this kind of error usually, MySQL service crash on your DigitalOcean Droplet. so, in this article we discuss about what cause MySQL crashing and how we can fix them.
How to stop MySQL crashing in DigitalOcean?
There are lot of ways to fix MySQL in DigitalOcean. if you want your website get back running fine?, just restart your MySQL server through PuTTy with following command.
Steps to fix Error establishing a database connection:
Step1: Go to the PuTTy, Enter your domain IP address on the red marked row below & press Open.
Step2: Where do we find our domain IP address?
sign in to your DigitalOcean in the droplets section you find your Domain name and IP address.
Step3: Work in PuTTY
Login as: (Your username)
once it get redirect use this command “service mysql restart”
Step4: Just reload your website. Here you go.