Limiting the number of records from mysqldump?

前端 未结 4 809
清酒与你
清酒与你 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:31

    As skaffman says, use the --where option:

    mysqldump --opt --where="1 limit 1000000" database
    

    Of course, that would give you the first million rows from every table.

提交回复
热议问题