I'm using mysqldump in a cron job to backup a database with over 2 million rows.
It creates a text file which can be used to restore the datalog from the command line.
I thought it would be useful to edit the dump before a restore as a quick way of changing values and table or column names - at least until I learn more and become confident about doing it with ALTER and UPDATE.
Editing large text files does not bother me, but I was surprised to find that in a 250 megabyte dump of my database, there were only about 300 lines. Each line was something like 800k characters long.
Is there another way of generating dumps with more control over line length?
Or should I post-process the dump with tools like sed or Perl?
mysqldump
. It was first reported in 2004. In 2011, both Tim Riker & Lon Binder suggested a 1-line patch to fix it. Mindbogglingly, this still has not been implemented by themysqldump
developers/maintainers. Because the original bug report was closed (wrongly and unhelpfully), the issue is now being tracked here.