Hi,

mysqldump can sort by primary key, but only ascending.

mysqldump can not limit the number of rows.

I have added two options: 

--order-by-primary-desc 
                      Sorts descending each table's rows by primary key, or
                      first unique key, if such a key exists.  Useful when
                      dumping a MyISAM table to be loaded into an InnoDB table,
                      but will make the dump itself take considerably longer.

--limit[=name]      (numeric!) Number of rows of each table to dump, 0=all
                     rows

I do need the number for "limit" as a string, so I try to avoid converting it into numbers and back into string.

Greets - Marco Gergele