Detailed explanation of the example of exporting data from a specified table in MySQL

Detailed explanation of the example of exporting data from a specified table in MySQL

Detailed explanation of MySQL exporting data from a specified table

Require:

1. Do not export the statements for creating a table, because the table has already been created: by default, it will be exported, first drop table 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 to see more clearly: No by default;
4. Generate multiple insert statements 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

in:

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

mysqldump --help says

 -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.)

If you have any questions, please leave a message or come to the community to discuss. Thank you for reading and I hope it can help you. Thank you for your support of this site!

You may also be interested in:
  • mysql mysqldump only exports table structure or only exports data implementation method
  • How to import and export databases and data tables in mysql
  • An illegal shutdown caused the MySQL data table to be damaged.
  • Detailed explanation of Linux mysqldump exporting database, data, and table structure
  • Import data from different tables in different databases in mysql
  • The solution to the problem that the Discuz! forum data table cannot be found due to mysql running permissions!
  • How to delete table data in MySQL
  • MySQL realizes the synchronization of data between two tables
  • Mysql updates certain fields of another table based on data from one table (sql statement)
  • Detailed explanation of MySQL multi-table data record query
  • Examples of importing and exporting MySQL table data

<<:  Detailed explanation of CocosCreator optimization DrawCall

>>:  Alibaba Cloud Centos7 installation and configuration of SVN

Recommend

Several navigation directions that will be popular in the future

<br />This is not only an era of information...

A set of code based on Vue-cli supports multiple projects

Table of contents Application Scenario Ideas Proj...

How to use MySQL group by and order by together

Suppose there is a table: reward (reward table), ...

How to install and persist the postgresql database in docker

Skip the Docker installation steps 1. Pull the po...

How to use native JS to implement touch sliding monitoring events

Preface I wrote a small demo today. There is a pa...

A brief analysis of Linux network programming functions

Table of contents 1. Create a socket 2. Bind sock...

Complete MySQL Learning Notes

Table of contents MyISAM and InnoDB Reasons for p...

Detailed explanation of querying JSON format fields in MySQL

During the work development process, a requiremen...

canvas.toDataURL image/png error handling method recommendation

Problem background: There is a requirement to tak...

How to build gitlab on centos6

Preface The original project was placed on the pu...

Tutorial on compiling and installing MySQL 5.7.17 from source code on Mac

1. Download and unzip to: /Users/xiechunping/Soft...