How to Import/Restore MySQL Database backup Using phpMyAdmin

Restore MySQL Database – Backups are an important aspect of website maintenance. Backing up your files and databases weekly or monthly, or before making any significant changes, ensure that your files are secure and recoverable in the event of data loss.

A backup MYSQL database will save all the data in a specific database. MySQL database can be handy for backing up valuable data from several scripts; unfortunately, it only provides a partial backup. It will not include DNS, home directory files, or other system files and configurations.

Backing up your site’s files is relatively straightforward. In essence, you put them all in an archive, which you can later extract and restore everything. When it comes to generating backups of your MySQL databases, however, things are a bit more complicated.

2 different types of database backups, below i am sharing 2 different types details,

Types of MySQL Backups

MySQL is a relational database management system used by most modern websites and applications. The information is stored in tables, with relations between the different datasets. In effect, these relations build the structure of the database.

A working backup of a database must be able to recreate the tables and the relations between them in the way they are originally organized. Ideally, it must do it quickly and efficiently in order to minimize service interruption.

There are two main types of MySQL database backups:

1. Logical backups

A logical backup exports (or dumps) the data and the data structure to a file with an SQL extension. SQL files are created by running scripts either through a third-party GUI-based tool or from a shell. Once generated, the backup can be stored locally, sent to another device on the network, or, ideally, transferred to an offsite location (it could be a server located in a different center, but it could also be an account with a popular cloud storage provider like Dropbox, for example).

In addition to the data itself, a logical backup contains the SQL statements (e.g., CREATE DATABASE, CREATE TABLE, etc.) – instructions that enable MySQL to rebuild the database with the correct table structure and relations. The main advantage of logical backups is that they can be used to transfer a database from one host to another.

2. Physical backups

A physical backup is a snapshot of the database’s datadir directory. All the tables and the data inside them are copied in their original file formats and can be restored in a fully functioning database as long as the structure is maintained.

Physical backups are quicker but can only work if they are restored from the same database engine on the same MySQL version. Hence, they aren’t always suitable for moving a database from one environment to another.

Your backup strategy should be determined by a number of different factors including the hosting setup, the database size, and your requirements.

Logical backups tend to be more common because, as we’ll find out in a minute, there are several ways of creating them, with tools readily available and fairly easy to use. Furthermore, logical backups can copy individual database objects, giving you more flexibility and a quicker resolution when you’re dealing with data corruption problems in specific tables. They are also more suitable if you’re looking for an incremental backup solution.

Overall, while physical backups do make sense in a few specific scenarios, for the regular website owner, logical ones are easier to set up and manage. That’s why today’s article will focus on them.

Restore MySQL Database using phpMyAdmin

Step 1: Login to cPanel control panel

Step 2: In the cPanel home page, navigate to the Databases section and click the phpMyAdmin icon. am-php-my-admin

Step 3: Select your database by clicking on the database name, e.g., “administ_samplewp”.

Step 4 :  Click on the Import tab in the top center pane.

Under the ‘File to import’ section, click Browse and locate the file with the .sql extension you wish to import.

Check or uncheck the boxes for ‘Partial import’ and ‘Other options’.

From the ‘Format’ dropdown menu choose ‘SQL’.

Click the Go button at the bottom to import the database.

Restore MySQL Database

In our previous blog post you can know the more details about How to take MySQL Database backup Using phpMyAdmin

You may also like...