How to fix a missing WordPress database error after restoring site files

You restore your files from a backup and they come back, wp-config.php and all. Then you go to restore the database and it isn’t there.

Your backup isn’t gone. Deleting the site removed the database container, so there’s nothing for the backup system to map your history to. Rebuild the container and the backup reappears.

Note: While the steps below are for the Hostinger panel, the underlying logic applies to any web host. If your host uses cPanel, just ensure you grant “All Privileges” when linking your recreated user to the database.

Step 1. Copy the missing database details

Get the exact credentials of the database that vanished.
(This is done after you have restored your files from a backup.)

  1. Open your hosting File Manager.
  2. Go to your site’s root folder. Open wp-config.php.
  3. Find the name, user, and password lines. Copy all three exactly:
define( 'DB_NAME', 'your_database_name' );
define( 'DB_USER', 'your_username' );
define( 'DB_PASSWORD', 'your_existing_password' );

The characters matter. One typo and the restore won’t map.

Step 2. Recreate the empty shell

Rebuild the missing container so the server reconnects your account to its backup history.

  1. Go to Databases (or MySQL Management) in your hosting panel.
  2. Select Create a New Database.
  3. Use the exact name, username, and password from Step 1. Don’t invent a new password, reuse the one already in wp-config.php, or the connection will fail even with the right name.
  4. Click Create.

You now have an empty container with the right name. The name is what the backup system looks for.

Step 3. Trigger the restore

The name exists again, so the backup system will recognize it.

  1. Open Backups, then Database Backups.
  2. Click the database dropdown. Your old name is back in the list.
  3. Pick a backup date.
  4. Click Restore.

Important to know: Your newly created shell might not appear in the dropdown on the most recent backup date. Pick an earlier date instead, that’s where it showed up for me. Keep stepping back until your database name appears in the list.

The result

The server extracts your historical tables into the shell you just built. Your reinstalled wp-config.php already matches the credentials, so the connection just works. Clear your browser cache, refresh, and the site loads.