Home > Database > Mysql Tutorial > How to export data from a specified table in MySQL

How to export data from a specified table in MySQL

黄舟
Release: 2017-09-11 11:10:56
Original
1619 people have browsed it

This article mainly introduces relevant information about the detailed explanation of MySQL exporting data in the specified table. I hope this article can help everyone. Friends in need can refer to

Detailed explanation of MySQL export specification Data in the table

Requirements:

1. Do not export the table creation statement because the table has already been created: the default is To export, first drop table and then create table;
2. Add ignore to the exported insert statement, allowing repeated execution: ignore will not be added by default;
3. List the fields in the table in the insert statement, see More clearly: not by default;
4. Multiple insert statements are generated for each record, which is easier to modify: the default is one;

The final result is as follows:


mysqldump -pxxxxxx qzt qf1_mail_account --no-create-info --insert-ignore --complete-insert --skip-extended-insert >qf1_mail_account.sql
Copy after login

Among them:

-pxxxxxx Specify password
qzt database name
qf1_mail_account table name
>qf1_mail_account.sql Save to file

mysqldump --help wrote


 -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.)
Copy after login

The above is the detailed content of How to export data from a specified table in MySQL. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template