I want to take a dump of a database, but the condition is to have only 100 records from each table in the DB?

link|improve this question
feedback

1 Answer

I found a small hack for doing that in the MySQL manual (comment):

mysqldump -u [username] -p [dbname] {--opt} --where="true limit 100" > dump.sql
link|improve this answer
That's hideous and hilarious. Well-played. And here I was writing a script! – BMDan Aug 24 '10 at 10:26
People can be really creative in finding solutions :D Like that proverb, all roads lead to Rome. – Lekensteyn Aug 24 '10 at 10:29
I'm starting to believe that in shell every problem can be solved in one line. – Janne Pikkarainen Aug 24 '10 at 12:32
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.