MySQL exports data from a specified table

Source: Internet
Author: User
Requirements for MySQL to export data in a specified table: 1. Do not export the statement for creating a table, because the table has been created: exported by default, droptable and then createtable; 2. exported I

Requirements for MySQL to export data in a specified table: 1. Do not export the statement for creating a table, because the table has been created: exported by default, drop table first and then create table; 2. exported I

MySQL exports data from a specified table

Requirements:

1. Do not export the statement for table creation, because the table has been created: exported by default, drop table first and then create table;
2. Add ignore to the exported insert statement to allow repeated execution: ignore is not added by default;
3. List the fields in the table in the insert statement. You can see more clearly: No by default;
4. Multiple insert statements are generated based on records, which are easy to modify: one statement is used by default;

The final result is as follows:

Mysqldump-pxxxxxx qzt implements invalid mail_account -- no-create-info -- insert-ignore -- complete-insert -- skip-extended-insert> too many mail_account. SQL

Where:

-Pxxxxxx specify the password

Qzt Database Name

Qf1_mail_account table name

> Qf1_mail_account. SQL: Save it to a file

Mysqldump -- help writes

-T, -- no-create-info
Don't write table creation info.
-- Insert-ignore Insert rows with insert ignore.
-C, -- complete-insert
Use complete insert statements.
-E, -- extended-insert
Use multiple-row INSERT syntax that include several
VALUES lists.
(Defaults to on; use -- skip-extended-insert to disable .)

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.