WordPress.org

Support

Support » Installation » Can't connect to distant Mysql database from local install

Can't connect to distant Mysql database from local install

  • Hello,

    I need to install a local version of an existing WP blog.
    I want the local install to use my distant Mysql database.
    I am getting an “Error establishing a database connection” error.

    Notes about the situation:
    I am using Windows 7
    I deployed WampServer 2 locally
    I defined virtual hosts, and it works fine with static local sites.
    My local wp-config.php is an exact copy of the distant one (the user/password therefore can’t be wrong since the distant site works; likewise the db host name is correct).
    DB_HOST is set to the full DB server host name.
    I can ping it from the Windows 7 machine.

    Could anyone suggest what might be going wrong?

    Thank you.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hi,

    You’ll have to enable remote access to mysql and you’ll also have to provide the current mysql user with full access to the database.

    [edit: sig removed as per the forum guidelines]

    Hi Pranav,

    Thanks for your answer.
    I confirmed with my web host that remote access is allowed and it should work.
    Regarding the current mysql user rights, well, accessing the database is working fine from my distant site, so I guess this proves there should not be any issue on that side. (Unless I am missing something of course.)

    Any other suggestion?

    Thanks.

    Have you entered the correct mysql host in WordPress config?

    As I said in my initial post above, my local copy of wp-config.php is an exact copy of the one on my distant site, which works fine. Therefore all information is necessarily correct: mysql host, username and password.

    Try setting DB_HOST to the server’s IP address instead.

    Thanks for the suggestion but it doesn’t work either. Same error message.

    Any other suggestion? Might it be linked to Windows 7 and some obscure port or firewall issue?

    Yeah, a firewall issue might be possible. Try disabling your firewall.

    I disabled it, but unfortunately it still doesn’t work.

    I might add that I have tried this with various WP version including 3.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Can't connect to distant Mysql database from local install’ is closed to new replies.