Support » Installing WordPress » Setting up WP with remote database

  • Hi,

    I’m trying to set up WP while using a remote database connection as the server I have WP installed on has outdated MySql. I have all of the information correct in wp-config.php and it’s still telling me is can’t connect to the database to continue the install. Here is the snippet of code I currently have:

    define(‘DB_NAME’, ‘gallcablog’);
    /** MySQL database username */
    define(‘DB_USER’, ‘mikegallca’);
    /** MySQL database password */
    define(‘DB_PASSWORD’, ‘passwordhidden’);
    /** MySQL hostname */
    define(‘DB_HOST’, ‘’);

    I’ve been able to log into myphpadmin fine and see the database I’ve created with the login details above, but for some reason it’s not taking. I’ve also tried adding the port to the end of the hostname with no luck. Please keep in mind Localhost isn’t an option as I am connecting from a remote mysql host.

    Any suggestions?



Viewing 3 replies - 1 through 3 (of 3 total)
  • The first thing I would check is whether or not your database user is permitted to connect remotely. If you’re using phpMyAdmin to manage your databases, all you have to do is click on the Privileges tab, and check the host column. If it’s set to “localhost”, then that user can only access the database from the same server as the database. If you want to access remotely, you’ll need to change it to either “%” for any server, or to the specific IP Address of the server you’re trying to connect from.

    If that’s not the problem, I would try using the database server’s IP address as the hostname in your wp-config.php file.

    Also, if you are using a cPanel based server you may need to add the IP address of the connecting server in Remote MySQL connections.

    Also, if you are using a shared hosting account, be sure to include your account prefix before the database name and user name.

    I have a Bluehost shared hosting account and this is how I connect to my database remotely:

    DB_NAME: accountprefix_databasename
    DB_USER: accountprefix_databaseuser
    DB_PASSWORD: ********
    DB_HOST: box***

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Setting up WP with remote database’ is closed to new replies.