My wordpress site is down after what probably comes down to me doing things in the wrong order. What I’ve done is the following:
Setting up a droplet with a one-click wordpress site, but since I was planning to move an existing domain name to this new site only after building it, I didn’t configure the domain name or ssl certificate at this point.
Built the wordpress site in the browser via the ip-adress.
Pointed the domain to the new ip adress. (Created two A records for @ and www).
Backtracked and managed to get the document root pointed to the right directory again etc.
Rebooted droplet to set up hostname and https via the built in scripts, but after doing this, the wordpress site can no longer establish a database connection. My hypothesis is that something is pointing in the wrong direction, e.g. some wordpress config not dealing properly with the hostname. I’ve tried debugging through this tutorial: https://www.digitalocean.com/community/tutorials/how-to-debug-the-wordpress-error-establishing-database-connection , but I can’t get the repair script to run (same error), and something tells me the problem is not corrupted tables but something more fundamental.
Can anyone make sense of this mess?
Submit an answer
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!
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.
I solved this by 1) updating the 000-ssl file with the correct server names. 2) reinstalling the certificates, 3) defining the site url in the wp-config, that was what created the worst headache, since wordpress was trying to mix and match the ip with the domain. Thanks a lot!
Make sure that the MySQL service is actually running
sudo systemctl status mysql
If it is not running, try to start it.
As you mentioned make sure that the document root in the virtual host is pointing to the correct location and also disable any virtual hosts that are not being used.
Check the database credential details in your wp-config.php and make sure that they are correct.
Let me know how it goes.
Regards,
Bobby
Try DigitalOcean for free
Click below to sign up and get $200 of credit to try our products over 60 days!
I solved this by 1) updating the 000-ssl file with the correct server names. 2) reinstalling the certificates, 3) defining the site url in the wp-config, that was what created the worst headache, since wordpress was trying to mix and match the ip with the domain. Thanks a lot!
Hi there @mbjorkas,
I could suggest a couple of things:
If it is not running, try to start it.
As you mentioned make sure that the document root in the virtual host is pointing to the correct location and also disable any virtual hosts that are not being used.
Check the database credential details in your
wp-config.php
and make sure that they are correct.Let me know how it goes. Regards, Bobby