Mysql Databases use tools and command lines to export, import, and backup data

Source: Internet
Author: User

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"

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.