Support » Fixing WordPress » Database not connecting

  • Hi Folks

    I am moving a WP site from one server to another and have done this successfully several times with no problems. However in this particular instance I have uploaded the site directory structure and when I create a new database I get connectivity…however, when I import the database tables I get an “error establishing database connection” when the path, username and password have not changed! the minute delete the site and create another new blank database I get connectivity again…

    I can only assume that there must be a permissions issue within the database itself, although my understanding is that if there is connectivity the site will work as it has in the past.

    The site in question is

    Thanks so much for any help!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Krishna



    Did you drop the tables of the existing database before importing and check your database username, password, db name, and db host in the config.php file? Error Establishing Database Connection is usually associated with correct entries in the config.php file.

    There is another aspect: your site is also returning error: HTTP/1.1 500 Internal Server Error. The cause could be anything including your server configuration for which you need to contact your host.

    Hi Krishna

    The “blank” database is connecting fine and then disconnects when I import the database into it. Does the database itself contain the username and password or can you import the contents of the database into a new database and set the config.php file accordingly? As stated in my original thread I only lose connectivity when I import the data from the database into the new one, which is connecting fine until the tables from the old database are imported.


    Are you importing the mysql database as well? You only need to import the database with the WordPress tables.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Database not connecting’ is closed to new replies.