Connect to remote database using Localhost install

I think s_ha_dum is in the right track, but I think he got it backwards.

You want to:

  1. develop/design locally
  2. connect to the REMOTE database and work with his content?

You need a remote (staging) installation of WordPress, where the client can create/enter his content.

You need your local WordPress site (localhost) to point to the remote database, to grab the content he is using.

So, you would have your http://example.com/wordpress set up for the client to edit – just even with a vanilla WP install. This site would be connected to it’s own database.

Your localhost site would have the REMOTE site’s database credentials, with the DB_HOST set to http://example.com, or whatever the mySQL path is if it’s accessed another way through your hosting provider.

On your local site, keep the WP_SITEURL and WP_HOME set to localhost. Otherwise, you’ll get redirection loops.

Leave a Comment