Connect local WordPress Site to remote database

database, local, wordpress

Solution

It's possible, yes.

- Make sure your local IP is whitelisted on your database's server to allow remote connections.

- Open wp-config.php and change the `define('DB_HOST')` bit so that it reads `define('DB_HOST', 'your.domain.name');`. You can also use the IP address.

- Test out the connection.

Problem

I develop WordPress themes locally but have a demo of the same site on a remote server. What I'd like to do is develop locally but have the local site connect to the remote database instead of having to sync the databases frequently. Is it possible to have a local WordPress site connected to a remote database instead of connecting through a local MAMP database? And, how might I go about doing this? My remote server is a VPS with GreenGeeks. Thanks for the help. Denis

Original source