I. Export and Import tools
There are many MySql database tools, such as MySql Administrator, Navicat, and SQLyog. Here we use MySql Administrator as an example.
Export:
Open MySql Administrator, click Backup on the left, click New Project in Backup Project, enter the Project Name, select the database to be backed up from the left to the right, and then select the data table to be exported, click Execute Backup Now. In addition, you can select Advanced backup parameters in Advanced Option, and create a scheduled backup plan in Schedule.
Import:
In the Restore open Backup File, select Another Schema for Target schema, find the database to be imported, and click Start Restore.
Ii. Export and import through the command line
Although various tools are easy to export and import, they are prone to problems that do not support exporting backup files from other tools. Therefore, it is necessary to know how to use the command line to export and import data. To use the following command, you must add the mysql command to the system path or switch the directory to the mysql \ bin directory.
Export:
Command mysqldump-h hostName-u userName-p databaseName> backupFileName. SQL
The hostName after-h is the connection address (the local machine is omitted), the userName after-u is the user name,-p indicates logging in with the password, databaseName indicates the name of the database to be exported, and backupFileName indicates the backup file name.
For example, mysqldump-u root-p stateOnline> statedump. SQL
Enter the password "Enter password:" After you press Enter. You can export the password after you Enter it.
Import:
Command mysql-h hostName-u root-p databaseName <backupFileName. SQL
The hostName after-h is the connection address (the local machine is omitted), the userName after-u is the user name,-p indicates logging in with the password, databaseName indicates the name of the database to be imported, and backupFileName indicates the backup file name.
For example, mysql-u root-p stateoffline <statedump. SQL
Enter the password "Enter password:" after entering the password, the import will be completed.
Author "why"