Steps for backing up and restoring a MySQL-Front Database

Source: Internet
Author: User

MySQL-Front is a mysql database management tool that can effectively manage mysql databases. Next I will introduce how to back up and restore MySQL databases using mysql-Front.

1. Back up the database

After the MySQL database is created, we need to back up the database frequently to ensure that the data can be restored to the maximum extent after the loss. There are many ways to back up the database. There are also some tools dedicated to backing up MySQL data, such as the Empire backup king. However, the most common backup method isMySQLThe order database is exported as an SQL file with the suffix ". SQL". The SQL file is an SQL script file.
In MySQL-Front, you can export the entire database as an SQL file or other types of files, or export a table as an SQL file or other types of files separately, the export method is: Right-click the database or table to be exported → export → select the exported file type.

Figure: Export Database Operations

Figure: Export Database _ save as a file

Figure: backup options
When backing up a database, You must select the relevant backup options (6-16). The following describes the options:
(1) Export content: there are two options. "Structure" refers to the structure of the database and table, and "data" refers to the specific data in the table.
(2) Options: There are three main items.
(A) "databases" include "creating databases" and "listing databases ". If you select "create database", the exported Code contains the "create database 'database name'" statement. If you select "list databases", the exported Code contains the "USE 'database name';" statement.
(B) "existing data" includes "deleting previously created data", "replacing", and "Scaling including querying. The "existing data" option controls how the restored data and existing data coexist when restoring the database. If you delete a previously created database, the database with the same name or the table with the same name under the same name in the server will be deleted during restoration ". Therefore, before restoring the database, remember to back up the original database to avoid database loss.
(C) "information" refers to some other related information.
When backing up a database as an SQL file, pay attention to the naming of the file. Generally, we back up the database multiple times a day. Therefore, it is necessary to name it well for future convenience. Generally, we name the database in the form of "database name + year, month, and day", for example, mydatebase_20120325. SQL.

2. Restore the database

After the database is backed up, you can restore the backup SQL file to the server. Before restoring the database, remember to back up the original database to avoid database loss. The restoration method is to right-click the server name → open → select the file to open (generally an SQL file ).

Figure: Restore A Database

Figure: Restoring database _ selecting files
Sometimes an error is reported when you restore the database using this method. Common Errors include:
(1) garbled characters caused by Chinese Encoding Problems. Solution: import data using the SQL Editor, right-click the SQL editor, and paste the data from the file.
(2) The database already exists. If the SQL code for restoring the database contains the "CREATE DATABASE" but does not have the "delete previously created" code, and the database already exists at the time of import, this error is reported. Solution: delete an existing database.
(3) The database does not exist. If the SQL code for restoring the database does not contain the "CREATE DATABASE" code and the database to be restored is not selected, this error is reported. Solution: if the database to be restored does not exist, create one. During restoration, select the database.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.