By skinniyah
I have wordpress setup on two separate droplets. Files are on one droplet and DB is on a separate droplet. wp-config.php was edited with DB_HOST reflecting the private IP of the DB server.
This has suddenly stopped working - site is give me a “error connecting” message. However, if I use the public IP of the DB server, then the site works.
Anything I’m missing?
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!
Can you ping the private IP address from the other droplet? How about connecting to the remote database manually:
<pre> mysql -u wordpressuser -h database_server_IP -p </pre>
This article should help point you in the right direction:
If both of those fail, run ifconfig on the database server. You should see entries for both “eth0” and “eth1” If you don’t then the private network isn’t up at all. In that case, try running:
<pre> ifup eth1 </pre>
pinging works.
I was also able to manually connect using the mysql command, both to the public and private IP.
ifconfig shows both eth0 and eth1
Private IP just won’t work if I try to access from PHP files or wordpress.
Follow up - I don’t know if it was the repeated restarting of mysql or what it was, but I can now connect to 2/3 of my databases using both private and public IPs. However, I get this error when I try to access the 3rd remote DB using the exact same file:
Could not select database: Access denied for user
Thanks for helping with this.
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.