WordPress.org

Ready to get started?Download WordPress

Forums

Error establishing a database connection on changing hosts (9 posts)

  1. garypeg
    Member
    Posted 4 years ago #

    I am changing from one url to another (actually both on megabyet but different urls). I follow these instructions from http://codex.wordpress.org/Moving_WordPress.

    Make a copy of your database. You will need to edit the .sql file, and in case of errors, it is important that you work on a copy.

    Begin the process of working from copies of your backups.

    1. If you have changed domain, edit the backed up database file to reflect this. A simple way to do this is:
    1. Using a text editor, open a copy of the .sql database file.
    2. Using the search and replace function, find all instances of the blog's old URL and replace it with the new URL.
    3. Repeat the process with your old email address. (For example, replacing someone@example.com with someone@tutorial.com)
    4. Save your changes.
    2. Upload your plugins and themes from your old site to the new one.
    3. Drop (delete) the database tables of the pre-installed Fantastico web.
    4. Restore the database.

    Now I get 'Error establishing a database connection.' I have edited wpconfig.php to make sure the data base names match and also password.

    What might be the problem? Thanks gary

  2. garypeg
    Member
    Posted 4 years ago #

    Also the data base user name matches. I am using Fantastico.

  3. Samuel B
    moderator
    Posted 4 years ago #

    Error establishing a database connection

    I've never seen that error be wrong if the server is running, so one of the db values is wrong in wp-config.php.
    Log in to phpmyadmin and verify the info

  4. garypeg
    Member
    Posted 4 years ago #

    Also the data base user name matches. I am using Fantastico.

  5. garypeg
    Member
    Posted 4 years ago #

    Not sure what to verify. Sorry I am very new at this.

  6. garypeg
    Member
    Posted 4 years ago #

    I ran analysis and everything checked out ok.

  7. Samuel B
    moderator
    Posted 4 years ago #

    then the only other option is the db server is down

  8. erbrown777
    Member
    Posted 3 years ago #

    @garypeg I am having the same error. Did you resolve this?

  9. @erbrown: you're asking in a 9 month-old thread. If you are getting "Error establishing a database connection", check your wp-config.php and check again. If not, start a new thread.

Topic Closed

This topic has been closed to new replies.

About this Topic