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

Use Xshell to connect to the Linux virtual machine on VMware (graphic steps)

Preface: I recently started to study the construc...

How to install Zookeeper service on Linux system

1. Create the /usr/local/services/zookeeper folde...

Tutorial on using hyperlink tags in XHTML

Hyperlink, also called "link". Hyperlin...

A quick solution to accidentally delete MySQL data (MySQL Flashback Tool)

Overview Binlog2sql is an open source MySQL Binlo...

Mysql 8.0.18 hash join test (recommended)

Hash Join Hash Join does not require any indexes ...

Example of implementing grouping and deduplication in MySQL table join query

Table of contents Business Logic Data table struc...

HTML Several Special Dividing Line Effects

1. Basic lines 2. Special effects (the effects ar...

Website construction experience summary

<br />What principles should be followed to ...

Detailed tutorial on using the Prettier Code plugin in vscode

Why use prettier? In large companies, front-end d...

Detailed installation tutorial of mysql-8.0.11-winx64.zip

Download the zip installation package: Download a...

Sharing several methods to disable page caching

Today, when developing, I encountered a method wh...

Using MySQL database with Python 3.4 under Windows 7

The detailed process of using MySQL database with...

Share 16 burning flame effect English fonts treasure trove

We live in a visual world and are surrounded by m...

Use PS to create an xhtml+css website homepage in two minutes

There are too many articles about xhtml+css websi...

New ideas for time formatting in JavaScript toLocaleString()

Table of contents 1. Conventional ideas for time ...