Support » Fixing WordPress » how to re connect database to wordpress

  • I accidentally deleted the database. Luckily it was retreived from server backup and replaced but the website won’t load and I can’t access wp-admin using (replacing mydomain with the correct name)

    I have downloaded the database as a .sql file.
    I have looked at wp-config and checked the database name is correct, also tried various combinations of user and password because the user should have been admin and wasn’t and the password was a code of 12 letters.

    I have checked in MySql and decoded the MD5 password, and it is correct.
    Also checked I am named as a user in MySql

    I have checked and all wordpress folders etc are still existing, it was just the DB I deleted in error.

    I expect the answer is simple, but what do I do to reconnect the database with the wordpress website?

Viewing 4 replies - 1 through 4 (of 4 total)
  • I have downloaded the database as a .sql file.

    Don’t you have to restore that database via something like phpMyAdmin?

    See: Restoring_Your_Database_From_Backup

    My host replaced the database that I deleted in error and it’s visible in PHP MyAdmin. I meant I had also downloaded it so I have a copy.

    I have been looking at the user name and password, but realise now that I have been on the wrong track because all I want initially is to have the website back up and viewers don’t need passwords etc.

    Somehow the database has become unnattached from the wordpress installation.

    I have started again with a new subdomain.

    Installed wordpress using Fantastico

    Site comes up, I log in OK

    using phpMyadmin I go to the new empty database just created (wp_wrdp5), select Import, and import the database that was auto saved by my host.

    Refresh website and get a blank page

    refresh Dashboard and get error message “Error establishing a database connection”

    I have also tried importing a database I saved a while ago with no luck.

    Somehow the wordpress installation recognises wp_wrdp5 before the import but not after?

    I have tried this 4 times now, wiping everything each time, including resetting the fantastico data “$installed_in_root[“”] = 1;. ” back to 0.

    I have also tried deleting posts and pages immediately after the wordpress install, before importing new database – same result.

    What the heck am I doing wrong?

    UPDATE- I’m still unsuccesful.

    I have solved the error message, which was a wp-config file problem.

    But when I import the saved database I get a blank page- also if I import either of my last backups. The backups are .sql files, not xml backups from the dashboard.

    I can now import the default database back in after getting the blank page, display the page and can access the dashboard.

    Any ideas?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘how to re connect database to wordpress’ is closed to new replies.