• About Us
  • Privacy & Policy
HowTo's
  • Home
  • Commands
  • Linux
  • SCM
  • Git
  • Database
  • MySQL
  • Kubernetes
  • Docker
No Result
View All Result
  • Home
  • Commands
  • Linux
  • SCM
  • Git
  • Database
  • MySQL
  • Kubernetes
  • Docker
No Result
View All Result
HowTo's
No Result
View All Result
Home Database

Using Extended INSERT Syntax in mysqldump

June 22, 2024
in Database, Database Commands Examples, Database Commands Tutorial, Database Tutorial, MySQL, MySQL Commands, MySQL Commands Examples, MySQL Tutorial
A A
0
12
SHARES
105
VIEWS
Share on FacebookShare on Twitter

Using mysqldump with the -e, --extended-insert option enables the generation of SQL dumps that employ extended INSERT syntax. This syntax optimizes the dump process by grouping multiple rows into a single INSERT statement, thereby reducing the overhead of executing individual INSERT statements.

Let’s explore some examples to understand how this works:

Example 1: Dumping a single table with extended INSERTs:

mysqldump -e --extended-insert dbname tablename > dump.sql

This command dumps the table tablename from database dbname into dump.sql using extended INSERT statements.

Example 2: Dumping multiple tables with extended INSERTs:

mysqldump -e --extended-insert dbname table1 table2 > dump.sql

Here, table1 and table2 from database dbname are dumped into dump.sql with extended INSERTs.

Example 3: Dumping specific rows with extended INSERTs:

mysqldump -e --extended-insert dbname tablename --where="id < 100" > dump.sql

This command dumps rows from tablename where id < 100 into dump.sql using extended INSERT statements.

Example 4: Dumping with extended INSERTs and disabling triggers:

mysqldump -e --extended-insert --skip-triggers dbname tablename > dump.sql

Here, triggers are skipped while dumping tablename from dbname into dump.sql with extended INSERTs.

Example 5: Dumping with extended INSERTs and adding DROP TABLE statements:

mysqldump -e --extended-insert --add-drop-table dbname tablename > dump.sql

This command adds DROP TABLE statements before each CREATE TABLE in dump.sql, while using extended INSERTs.

Example 6: Dumping with extended INSERTs and including comments:

mysqldump -e --extended-insert --comments dbname tablename > dump.sql

Comments are added to the dump file dump.sql alongside the extended INSERTs.

Example 7: Dumping with extended INSERTs and using custom delimiters:

mysqldump -e --extended-insert --hex-blob dbname tablename > dump.sql

Hexadecimal notation is used for binary data (BLOBs) when dumping tablename from dbname into dump.sql with extended INSERTs.

Example 8: Dumping with extended INSERTs and limiting number of rows per INSERT:

mysqldump -e --extended-insert --max-allowed-packet=32M dbname tablename > dump.sql

This command limits the size of each INSERT statement to 32 megabytes when dumping tablename from dbname into dump.sql using extended INSERTs.

Example 9: Dumping with extended INSERTs and skipping comments:

mysqldump -e --extended-insert --skip-comments dbname tablename > dump.sql

Comments are excluded from the dump file dump.sql while using extended INSERTs.

Example 10: Dumping with extended INSERTs and specifying a different character set:

mysqldump -e --extended-insert --default-character-set=utf8 dbname tablename > dump.sql

The character set for the dump file dump.sql is set to UTF-8 when dumping tablename from dbname using extended INSERTs.

Also check similar articles.

Dumping Events Using mysqldump
Dumping Slave Position in mysqldump Output (Deprecated)
Dumping Replica Position in mysqldump Output
Disabling Keys in mysqldump Output
Deleting Master Logs in mysqldump (Deprecated)

Tags: DatabaseDatabase Commands ExamplesDatabase Commands TutorialDatabase TutorialMySQLMySQL CommandsMySQL Commands ExamplesMySQL Tutorial
Previous Post

Dumping Events Using mysqldump

Next Post

Setting Field Terminator in mysqldump Output

Related You may like!

howto

Overriding –databases Option in mysqldump

June 22, 2024
howto

Creating Tab-Separated Output Files with mysqldump

June 22, 2024

Handling Failed SSL Session Data Reuse in mysqldump

June 22, 2024

Setting SSL Session Data File in mysqldump

June 22, 2024

Setting TLS 1.3 Cipher in mysqldump

June 22, 2024

Configuring SSL FIPS Mode in mysqldump (OpenSSL Only)

June 22, 2024
Next Post
howto

Setting Field Terminator in mysqldump Output

howto

Enclosing Fields in mysqldump Output

howto

Optionally Enclosing Fields in mysqldump Output

Discussion about this post

Latest Updated

howto

How to Use -iname for Case-Insensitive Filename Searches in find

August 21, 2024
howto

Search for Files with Case-Insensitive Pattern Matching Using -ilname in find

August 21, 2024
howto

Find Files by Group Name with -group in find Command

August 21, 2024
howto

Locate Files by Group ID Using -gid in find Command

August 21, 2024
howto

How to Search for Filesystems with -fstype in find Command

August 21, 2024

Trending in Week

  • howto

    Using BTRFS Subvolume for User Home Directory in Linux

    22 shares
    Share 9 Tweet 6
  • Downloading Docker Images from a Registry

    13 shares
    Share 5 Tweet 3
  • Configuring SSL Connection Mode in mysqldump

    17 shares
    Share 7 Tweet 4
  • Omit Tablespace Information in mysqldump Output

    13 shares
    Share 5 Tweet 3
  • Setting MySQL Dump Compatibility Mode

    18 shares
    Share 7 Tweet 5
  • Setting Network Buffer Length in mysqldump

    13 shares
    Share 5 Tweet 3
  • Logging out from Docker Registries

    13 shares
    Share 5 Tweet 3
  • Scheduling Nodes in Kubernetes with kubectl uncordon

    12 shares
    Share 5 Tweet 3
  • Managing Default User Creation Settings in Linux

    15 shares
    Share 6 Tweet 4
  • Using Extended INSERT Syntax in mysqldump

    12 shares
    Share 5 Tweet 3
  • About Us
  • Privacy & Policy

© 2024 All Rights Reserved. Howto.swebtools.com.

No Result
View All Result

© 2024 All Rights Reserved. Howto.swebtools.com.