cloe
cloe

Reputation: 51

Connecting wordpress website to remote database

I have a wordpress website hosted on godaddy and would like to connect it to a remote mysql database. Is it possible to have this website connected with 2 databases?

Upvotes: 0

Views: 680

Answers (3)

Quixrick
Quixrick

Reputation: 3200

If you can't get it to work through 3306, there are a couple of alternatives.

The better of the two options is to use SSH. If GoDaddy supports this, try connecting to your remote server via port 22 and then log in to MySQL as the localhost user.

The other option is to set up a proxy to handle the request over port 80 or 443. A Google search turned up several to pick from (like this one http://www.phpclasses.org/package/4000-PHP-Execute-remote-MySQL-queries-across-the-Web.html), but as I haven't used any of them, I cannot recommend one over another.

Maybe some of the folks here can recommend one that works well.

Upvotes: 0

Ankit Pise
Ankit Pise

Reputation: 1259

Theres nothing special you have to do for it.

Just put login credentials of remote db server & make sure user has remote login allowed.

and make following changes in wp-config.php

/* MySQL settings */
define( 'DB_NAME',     'database_name_here' );
define( 'DB_USER',     'username_here' );
define( 'DB_PASSWORD', 'password_here' );
define( 'DB_HOST',     'SERVER_PORT/DOMAIN HERE' );
define( 'DB_CHARSET',  'utf8' );

why would you conntect website with 2 databases?

Upvotes: 0

snollygolly
snollygolly

Reputation: 1886

This isn't possible on GoDaddy shared hosting, you have to have dedicated hosting to get access to a remote database.

(I know because I tried and contacted their support, and this is what they said)

Upvotes: 1

Related Questions