mysqldump: dump rows matching certain criteria, or limit number of dumped rows
Posted: 23 September 2011 Filed under: development | Tags: command line, mysql, mysqldump, web development Leave a commentTo limit the number of rows dumped by mysqldump
, you can do:
mysqldump -u [user] -p[password] --where="true LIMIT 5" [database] [tablename] > outputfilename.sql
You could select other criteria as well:
mysqldump -u [user] -p[password] --where="userid > 24" [database] [tablename] > outputfilename.sql