Showing posts with label mysql mysqldump LIMIT. Show all posts
Showing posts with label mysql mysqldump LIMIT. Show all posts

Thursday, June 19, 2008

Grab N rows

mysqldump has a nice feature '-w' that I used today. Whilst working with a customer to migrate their 200G database from 4.1 to 5.1, we decided to grab a subset of the database to do initial tests with.
Using this:

mysqldump -w 'true LIMIT 1000'

I created a dump of 1000 rows of each table.

From:

http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html
--where='where_condition'
, -w 'where_condition'

Dump only rows selected by the given WHERE condition. Quotes around the condition are mandatory if it contains spaces or other characters that are special to your command interpreter.