Tuesday, March 17, 2009

Creating small samples of mysql dbs or tables

Table samples from a DB:

mysqldump --opt --where="true LIMIT 1000000" mydb > mydb1M.sql

Sample from 1 table:

mysqldump --opt --where="true LIMIT 1000000" mydb mytable > mydb_mytable_1M.sql


Source: http://www.ducea.com/2009/03/17/howto-get-a-small-sample-dataset-from-a-mysql-database-using-mysqldump/

0 comments: