MySQL Import and export

Source: Internet
Author: User
Tags mysql import

2015-09-23

MySQL Export

1. Export the database

Mysqldump-u User name-p password Library name > library name _backup.sql

2. Export only all table structures and do not export table data

Mysqldump-u User name-p password-d library name > library name _d_backup.sql

3. Export all table data only, do not export table structure

Mysqldump-u User name-p password-T library name > Library name _t_backup.sql

4. Export the table

Mysqldump-u User name-p password Library name table name > library name. Table name _backup.sql

5. Export table structure only, do not export table data

Mysqldump-u User name-p password-d library Name table name > library name. Table name _d_backup.sql

6. Export only table data, not export table structure

Mysqldump-u User name-p password-T library name table name > library name. Table name _t_backup.sql

MySQL Import

1. Import the database

Mysql-u User name-p password Library name < library name _backup.sql

2. Import only all table structures, not import table data

Mysql-u User name-p password-d library name < library name _d_backup.sql

3. Import all table data only, do not import table structure

Mysql-u User name-p password-T library name < library name _t_backup.sql

4. Importing tables

Mysql-u User name-p password Library name table name < library name. Table name _backup.sql

5. Import only table structure, not import table data

Mysql-u User name-p password-d library Name table name < library name. Table name _d_backup.sql

6. Import only table data, not import table structure

Mysql-u User name-p password-T library name table name < library name. Table name _t_backup.sql

MySQL Import and export

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.