• I want to move just my WP DB to an external server but leave the rest of the WP installation where it currently is, on a shared server.

    I’ve successfully moved the DB and have been able to log into it at the new IP using Sequel Pro, so I know my settings are correct.

    I’ve changed my wp-config.php file on my shared server from localhost to the new IP. The rest of the credentials have remained the same.

    I assumed that if I tried to log in as I usually do to my WP site, it should merely point to the new, identical DB in the new external location (the one I know I can access with Sequel Pro).

    Unfortunately … no. I can’t log in. Is there something else I need to change within WP?

Viewing 6 replies - 1 through 6 (of 6 total)
  • As long as your wp-config.php file has the right credentials and is connecting to the correct DB, then there’s no need to change anything in there and nothing else to configure.

    I’d suggest that you try resetting your password the standard way )using the form from the login page) and see if that works. if it does, then something has gone a bit haywire transferring your password across. If that doesn’t work, then double-check your DB connection details and make sure that the public side of your site is exactly the same as it was before.

    Thread Starter harveybeck

    (@harveybeck)

    I’m not even getting to the password request stage. I’m getting a failure to connect message:

    Error establishing a database connection
    This either means that the username and password information in your wp-config.php file is incorrect or we can’t contact the database server at

    However, the same credentials work for Sequel Pro. Frustrating!

    Could there be some kind of firewall setting at the host that would prevent traffic between the server and my WP files?

    If you can’t get past that it means that either everything is not the same, or there’s some block between your web server and the DB server.

    First thing to check that normally seems obvious, but is’t a lot of the time, is that you’ve changed the hostname as well as the username and password. I’ve forgotten that in the past, so I know that’s easy to do.

    If the connection details are 100% correct and you’re sure, then start looking at the network between the two servers and see what’s blocking the connection request. There could be firewall issues on either server, or there could be an issue with IP addressing or IP tables. Firewalls normally do create blocks for IP addresses that aren’t whitelisted, and normally the MySQL connection port is one that does get blocked pretty often.

    Thread Starter harveybeck

    (@harveybeck)

    I would have guessed the only issue would be firewall blocks on the host mySQL server – not on the server where my WP installation resides. I’ve demonstrated that’s not the case by accessing it from home via Sequel Pro. It also confirmed that my settings are correct.

    So the only issue seems to be the firewall where my WP installation resides. Perhaps there’s a need for them to whitelist the IP address for my mySQL host because there’s two-way communication?

    I’ve contacted my WP host; they seem to believe it’s not their firewall but from everything I see, that has to be the issue.

    Frustrating!

    have you tried to connect the DB using plain php see the code:

    mysql_connect("localhost/IP", "USER", "PASS") or die(mysql_error());
    mysql_select_db("DB_NAME") or die(mysql_error());

    put the php file on root dir and try to connect and read/write. if that works then its you wp_config file
    OR
    create a new MySQL user and then use that user to connect…

    Thread Starter harveybeck

    (@harveybeck)

    Problem solved. Looks like it was a firewall issue after all at my WP host. They didn’t realize that my account returned to their default “no remote access”, probably after a recent update at their end.

    Thanks for your help … amazingly quick response too!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Moving WP DB to external server but keeping main WP files on current server’ is closed to new replies.