Has something bad happened to your website?

If you have backed up your website, then you should be able to restore the SQL database of your site.

Restore SQL database via CPanel

The easiest way to restore an SQL database is via CPanel.  If your backup file is a standard SQL file, then you should be able to safely restore your database.

Steps to restore SQL database

Using phpMyAdmin, follow the steps below to restore a MySQL database.

  • Login to CPanel
  • Go to the Databases section
  • Click to phpMyAdmin – see image

restore-database

  • You may have to login to phpMyAdmin
    These details are created in CPanel.  If you cannot find them, contact your hosting or web developer
  • On the left side you will see all the databases – see imagedatabases
  • Select the database
    (you can find out the name from the web-config.php file from File Manager)
  • Click the Import tab
  • Click Browse
  • Select the backup file from your computer
  • From Format > Click SQL
  • Click the Go button
  • You should then see a message saying Import has successfully finished

You will need to go and check your website to see if that has restored your database properly.
Make sure your website looks the way it should look.

 

If there are any issues, you may have to create a completely new database and import the SQL back up file into it.

Create a new database and import the SQL file

  • Go to CPanel
  • Click on Databases
  • Click on MySQL® Database Wizard
  • Create a Database
  • Name the database
  • Click Next Step
  • Add a Username
  • Add a Password
  • Click create User
  • Select ALL PRIVILEGES
  • Click Next Step
  • That’s done
  • Save these details in Notepad or a plain text editor
  • Go back to phpMyAdmin
    To import the backup file into the new database
  • Select the new Database
  • click Import
  • Select the SQL backup file
  • Click GoNow you will have to connect the new databse the website
  • To reconnect the new database to your WordPress website
  • Download the old web-config.php file from your server via file manager in CPanel
  • Open the web-config.php file
  • Replace the old database username and password with the new one
  • Save
  • Upload backup to the server either via CPanel (File Manager) or FTP
  • This should connect your site to the new database and hopefully will fix any further issues

 

Click on this link for more information on how to restore SQL database.

https://codex.wordpress.org/Restoring_Your_Database_From_Backup

 

By Jodi Allbon
Original content 2014

Facebookgoogle_pluslinkedin