Thursday Dec 11, 2008

To complement my patches to show import progress using the mysql client I have created a minor patch to mysqldump.  This new patch for MySQL 5.1.30 will show you the number of rows dumped so far every 10,000 rows when using the --verbose parameter.  The output should be similar to this:

-- Retrieving table structure for table testing...
-- Sending SELECT query...
-- Retrieving rows...
-- 20000 rows dumped

Tuesday Dec 09, 2008

After a discussion with Mark Leith yesterday I decided to modify my import progress patch to have an option to turn it on/off.

This new patch adds a --show-progress parameter to the MySQL client which is disabled by default.  This is because there may be utilities or scripts using the MySQL client and capturing stderr output, the original patch would create some mess in this situation.  To use the new patch you can do:

shell> mysql --show-progress < importfile.sql

Monday Dec 08, 2008

Sometimes when importing data into MySQL using the following method it can take a very long time, especially if the file is very large in size:

shell> mysql < importfile.sql

I have therefore developed a tiny patch to the mysql client which uses stderr to show the progress of the import in number of lines every 1000 lines of import.  This isn't quite a progress bar but should give you an indication of how long the import will take.

The patch for MySQL 5.1.30 is available here.

This blog copyright 2008 by LinuxJedi