Join 1M+ other developers and:
- Get help and share knowledge in Q&A
- Subscribe to topics of interest
- Get courses & tools that help you grow as a developer or small business owner
Wordpress: Error Establishing a database connection - Vesta CP - Works For 30 Seconds After Reboot
Hello, I have several wordpress sites that have been working great on Digital Ocean up until today.
Now, all sites hosted on Digital Ocean are running into “Error Establishing a Database Connection”. (Similar sites I have not using Digital Ocean are just fine.)
When I reboot my droplet, I can connect and do anything I want on the sites for around 30 seconds - and then the database error reappears.
I am using Vesta CP (Vesta Control Panel). At the beginning of this problem I double-checked the username/password etc. for the databases that would also be located in the wp-config.php file. While the sites are down, it also shows “error connecting to localhost”.
Vesta CP also works for around thirty seconds after a quick reboot.
I created a swap file as shown here.
But the problem still persists. Any ideas?
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.×