This is a discussion on Happy medium for extended inserts within the MySQL Database forums, part of the Database Forums category; The default for mysqldump is to enable --opt, which in turn enables --extended-insert. This results in a smaller dump ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
The default for mysqldump is to enable --opt, which in turn enables
--extended-insert. This results in a smaller dump file that is faster to reload. However, it's extremely difficult to view a large dump in a text editor. Disabling the feature with --skip-extended-insert creates individual INSERT statements for each record, producing a larger file that is slower to reload. Is there any way to keep --extended-insert, but have each record dumped on a single line? I'm thinking of something like this: INSERT INTO `foo` VALUES ('1', 'Doe', 'John'), ('2', 'Doe', 'Jane'); instead the default: INSERT INTO `foo` VALUES ('1', 'Doe', 'John'),('2', 'Doe', 'Jane'); |
|
|||
|
On Sun, 28 Jan 2007 16:32:55 -0500, Jorey Bump
<devnull@joreybump.com> wrote: >The default for mysqldump is to enable --opt, which in turn enables >--extended-insert. This results in a smaller dump file that is faster to >reload. However, it's extremely difficult to view a large dump in a text >editor. Disabling the feature with --skip-extended-insert creates >individual INSERT statements for each record, producing a larger file that >is slower to reload. Is there any way to keep --extended-insert, but have >each record dumped on a single line? > >I'm thinking of something like this: > >INSERT INTO `foo` VALUES >('1', 'Doe', 'John'), >('2', 'Doe', 'Jane'); > >instead the default: > >INSERT INTO `foo` VALUES ('1', 'Doe', 'John'),('2', 'Doe', 'Jane'); Pipe it through sed replacing "),(" by "),newline(" -- ( Kees ) c[_] You don't win wars by dying for your country. You win by making the other poor bastard die for his country. (#226) |
![]() |
| Thread Tools | |
| Display Modes | |
|
|