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

React uses routing to redirect to the login interface

In the previous article, after configuring the we...

11 Examples of Advanced Usage of Input Elements in Web Forms

1. Cancel the dotted box when the button is press...

Solution to Vue's inability to watch array changes

Table of contents 1. Vue listener array 2. Situat...

MySQL and MySQL Workbench Installation Tutorial under Ubuntu

Ubuntu install jdk: [link] Install Eclipse on Ubu...

Mysql implements null value first/last method example

Preface We already know that MySQL uses the SQL S...

IIS7 IIS8 http automatically jumps to HTTPS (port 80 jumps to port 443)

IIS7 needs to confirm whether the "URL REWRI...

Analysis of the principles of Mysql dirty page flush and shrinking table space

mysql dirty pages Due to the WAL mechanism, when ...

IDEA2021 tomcat10 servlet newer version pitfalls

Because the version I used when I was learning wa...

Detailed tutorial for installing MySQL 8.0.11 compressed version under win10

After reinstalling my computer recently, I downlo...

Web page HTML code explanation: ordered list and unordered list

In this section, we will learn about list element...

js realizes packaging multiple pictures into zip

Table of contents 1. Import files 2. HTML page 3....

Example of how to create and run multiple MySQL containers in Docker

1. Use the mysql/mysql-server:latest image to qui...

Detailed explanation of the getBoundingClientRect() method in js

1. getBoundingClientRect() Analysis The getBoundi...

A brief analysis of the knowledge points of exporting and importing MySQL data

Often, we may need to export local database data ...