Limiting the number of records from mysqldump?

前端 未结 4 805
清酒与你
清酒与你 2020-12-12 09:51

I am trying to load a small sample of records from a large database into a test database.

How do you tell mysqldump to only give you n records out of 8 million?

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-12 10:41

    mysqldump can be given a SQL query to execute, from which it will take the data for the dump. You can then use the "limit X" clause in your query to restrict the number of rows.

提交回复
热议问题