Hi, Does anyone know how to connect a WordPress installation to a remote MySQL database? My host uses a separate database server so the code define('DB_HOST', 'localhost'); in the wp-config.php file doesn't work. I've tried putting the url in place of 'localhost' as well as the IP address as in define('DB_HOST', 'http://db.domain.comort'); and define('DB_HOST', 'http://xxx.xxx.xxx.xxxort'); where xxx.xxx.xxx.xxx is the IP address. Both give me a Error connection to database message. Usingthe IP address without 'http://' as in define('DB_HOST', 'xxx.xxx.xxx.xxxort'); gives me a CGI Error - The specified CGI application misbehaved by not returning a complete set of HTTP headers. Any ideas?
Try define('DB_HOST', 'xxx.xxx.xxx.xxxort') but without the port. It should default to the correct port, I would think. Also make sure the MySQL server allows remote hosts to connect with your credentials.
Yes, just using the IP address or the hostname (e.g. "my.example.org"), without any port or http part, would be enough for this.
Thanks for the input guys. I've changed the installation to WordPRess 2.3.1 and it works perfectly with define('DB_HOST', 'xxx.xxx.xxx.xxx:port'); Code (markup): Looks like the problem was with WordPress 2.3.2 and not the database connection. Thanks for your help.
run your WordPRess 2.3.1, backup all files then delete old files from V.2.3.1 but keep only wp-config.php when you have done all, then upload all new files from V.2.3.2 it will work perfect and easeir to install plugin. "dont forget CHMOD some files"
Here is the Stepbystep Tip: http://install-climber.blogspot.com/2011/08/wordpress-mysql-database-remote.html Thanks!
That is one way to do it, but there is also a new program in beta called JSONData.com that will update the database in real-time while allowing you to embed it anywhere (like a youtube video)
Well, when you try connecting to a remote database, make sure that your IP is white listed in the database server. Then only it will connect fine.