Question

Remote DB for Wordpress, No possible way of figuring it out

Posted October 19, 2021 103 views
MySQLWordPress

Hello, I tried to set up a separate remote wordpress DB last year and after 2 weeks of being unable to get it working, I stopped. I now have to try again as I really need it. I have read for several days again all tutorials but I am missing something which still does not let it work, hopefully someone can guide me.

Reference: Webserver = Wordpress Droplet / DB Server = Separate Droplet

Originally all was in one droplet that I had for 3 years, since the old droplets are not automatically in VPC like the new droplets, I snapshot it, created new droplet, all works well. So far, everything still one droplet.

I created a brand new droplet ( DB Server ), used the one-click Mysql install so all is configured, went thru some settings as instructed and works fine, I can access Myphpadmin with the Ip address/myphpadmin, I add users as instructed on the tutorials, I test the access..So on DB Server from the console, I use mysql u-username -p and perfect, the user I set up can log in, then I use console from Web-server, use the same login information with the host IP address that user access. Okay, perfect, so I know the DB Server allows Webserver to login with that user.

I take the Webservers database and export it, import it into the Db server, all shows up, the Db server is the same, exact DB name, tables, names, etc. Its a replica as if I was looking at the other one

I change my Wordpress Server config file with the new info like the DB Host Ip address etc and no connection, I have trouble shot just about everything over and over.

The only thing I can think of is does the DB Droplet which only has an IP address assigned to it, no domain, need to have any DNS settings on it? If so, is there a guide for remote DB dns settings with only IP no domain name?

I did do a SHOW VARIABLES WHERE Variable_name = ‘hostname’; and it shows the DB Droplet name, maybe that needs to say the IP address?

Here is the trouble shooting I have done:

  • Can the user connect from Webserver to DB server via console / Yes
  • Is the user name on WP config file correct / Yes
  • Is firewall disbaled / Yes, I disabled Firewall from Plesk
  • Are Mysql bind address updated / Yes, Db Server is pointing to its own Droplet IP address and Webserver is pointing to its droplet Ip
  • Is ssl enabled / Only on Webserver not the Db server, would be SSL going into non-ssl, don’t think that would be the cause, but I might be wrong
  • sudo ufw allow mysql / Yes
  • User Privileges / Yes, Grant All
  • DB Local and Remote User / Yes, both have same name and login, only different is one user has the IP address of Webserver which will access and the other is 'local"
  • Installed MySQL client utilities / No, server give error in package when trying to install
  • Added requiresecuretransport = on / No, not using SSL on DB
  • Can access from Plesk / No, when I add new DB in Plesk, I get connect error
  • Whitelisted Ip / Yes, added DB server IP to Plesk Whitelist

I think it might be the DNS settings, like the Domain trying to reach the IP but no DNS setting, I did add a NS record pointing the IP to the DO servers.

Thank You, any help would be appreciated

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.

×
Submit an Answer
2 answers

If so, is there a guide for remote DB dns settings with only IP no domain name?
Of course there must be a search. I don’t remember exactly where, but then I’ll unsubscribe and tell you, but I remember that it definitely was!

  • Thanks, been testing out more. I think its not the DNS as the Webserver is connecting direct to IP and DNS would be more for Domain name its self. I think the issue is that my Web server is using MariaDB and I tried installing Mysql client on it as instructions said but its Maria-Client I need. And then the DB server, the 1-click install on DO is Mysql not MariaDB, so it might be causing issue with different DB servers so Im now configuring it to see, I think its the Client that is missing so it can connect.

I figured out what the issue was, its a bit complicated as there was a lot of issues due to me already having a Plesk website installed and its was causing configuration issues with server settings. I have written a reply on the Plesk forum on what the issue was and how to fix it. I hope this helps someone.

https://talk.plesk.com/threads/plesk-as-database-management-with-only-ip-can-not-connect.362593/post-899978