WordPress.org

Forums

Problem establishing a database connection after move (8 posts)

  1. Alile
    Member
    Posted 8 years ago #

    I just moved hosts and I'm trying to get my WP blog up and running again. I changed the info in the wp_config.php file so it had my new database username and password, etc. But now it's saying:

    Error establishing a database connection

    This either means that the username and password information in your wp-config.php file is incorrect or we can't contact the database server at localhost.

    I already got another one of my sites that uses an SQL db up and running, so I don't think it's a problem with my host, but I'm 100% sure that the username and password is correct. I even added a second user to the db to see if a different username would work, but I got the same message.

    I don't know what to try now.

  2. Alile
    Member
    Posted 8 years ago #

    Ok then.

    Would I be able to get my blog back if I started from scratch? If I installed WP again from scratch and got it working, could I then just reupload my current blog files to the new WP folder and import the DB info in phpmyadmin and have it be my blog again?

  3. vkaryl
    Member
    Posted 8 years ago #

    Did you check with your host to make sure you're setting it up correctly?

    And yes, you can try redoing the whole maneuver. If you subsequently get the same error, then you need to talk to your host.

  4. Alile
    Member
    Posted 8 years ago #

    Thank you for responding.

    My husband managed to figure out the problem. We had to use the address of the host name and the port number instead of just using "localhost". I had tried using the host name before, but it only worked when coupled with the port number (separated by a colon).

  5. spencerp
    Member
    Posted 8 years ago #

    Oh ok, can this be changed to [Resolved] now, or..?

    spencerp

  6. tchandler
    Member
    Posted 8 years ago #

    actually, i'm having the same exact problem (changed hosts for two blogs; one switch worked, one didn't. getting the same error).

    i've gone through the backed-up database and tried doing a 'find and replace' for the absolute path (it's different on the new host), thinking that could be it...but still, same problem.

    allie, could you explain in slightly more detail what you had to modify?

    thanks for any insight.

    tchandler

  7. malcontent1138
    Member
    Posted 8 years ago #

    I just had to provide a more specific host name as I did my first installation of WordPress.

    "localhost" alone wasn't sufficient, I had to use

    "localhost:/tmp/mysql5.sock".

    I supposed we're falling into that 1% of the people for whom host "localhost" needs to be changed. :-)

  8. Samuel B
    moderator
    Posted 8 years ago #

    Check with your host. Some use an ip address - some use something like:
    mysql.siteserve.net or mysql.siteserve.net:port 3306
    etc.

Topic Closed

This topic has been closed to new replies.

About this Topic