Bug #12696 mysqldump -c not creating individual insert statements
Submitted: 20 Aug 2005 15:40 Modified: 21 Aug 2005 23:37
Reporter: Eric Egdorf Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:Ver 14.7 Distrib 4.1.13, for Win32 OS:Windows (Windows XP Pro)
Assigned to: CPU Architecture:Any

[20 Aug 2005 15:40] Eric Egdorf
Description:
I'm trying to create a dump file with separate insert statements for each row in the table.  When I use the -c or --complete-insert options I'm still getting the new format with only one insert statement.

This is the binary distribution for windows, I did not compile it.

How to repeat:
mysqldump dbname --complete-insert -u uid --password=pwd
mysqldump dbname -c -u uid --password=pwd
[21 Aug 2005 10:18] MySQL Verification Team
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.mysql.com/documentation/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php

Additional info:

-c option has nothing to do with extended INSERTs.
--extended-insert is enabled by default since 4.1. Use --skip-<option_name> to disable certain option.
[21 Aug 2005 20:00] Eric Egdorf
Merd, I put the wrong option in the ticket, should have been --complete-insert not --extended-insert, cut n' pasted the wrong line...  The skip option workd, thanks.   So, why list -c or --complete-insert if they don't do anything?
[21 Aug 2005 23:37] Paul DuBois
-c and --complete-insert *do* do something, but
complete inserts are different from extended inserts.
Complete inserts include the column list in the output.
Extended inserts are multiple-row inserts.
[19 Aug 2007 12:37] Matt Saunders
For the benefit of future readers:

the OP wanted output from mysqldump like this:
INSERT into mytable VALUES ('row1value1','row1value2');
INSERT into mytable VALUES ('row2value1','row2value2');

However he (as was I) was getting:

INSERT into mytable VALUES ('row1value1','row1value2'),('row2value1','row2value2');

The simple solution is to add --extended-insert=0 or --skip-extended-insert

Incidentally the --complete-insert option would give
INSERT into mytable ('columnname1','columnname2') VALUES ('row1value1','row1value2'),('row2value1','row2value2');

But for me it was just skip--extended-insert that I needed (to get data from mysql into an sqlite db, which doesn't seem to support multi-row inserts.)

HTH someone

Matt Saunders
Bit Different Limited
[1 Apr 2008 17:12] Derek Knapp
Matt Saunders, thanks for clarifying this, thats exactly what i am trying to do aswell