rubyprince
rubyprince

Reputation: 17793

Dump only 10% of the data in MySQL database

While taking a dump, is it possible to specify that we need 10% of the the data(or a fixed amount of records from each table)? The problem is I have a database with large amounts of data and the dump becomes very large. I want to dump so that the dump file will be smaller(not all data is needed).

Upvotes: 2

Views: 129

Answers (2)

Aurus
Aurus

Reputation: 705

SELECT * FROM your_table LIMIT 0, 5

0 -> the starting point 5 -> count of records.

Upvotes: 0

borrible
borrible

Reputation: 17366

Are you able to limit the amount of data using a WHERE clause? If so, the mysqldump utility offers a --where option.

Upvotes: 3

Related Questions