限制来自mysqldump的记录数? [英] Limiting the number of records from mysqldump?

查看:82
本文介绍了限制来自mysqldump的记录数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正尝试将一小部分记录样本从大型数据库加载到测试数据库中.

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

您如何告诉mysqldump仅给您800万条记录中的n条记录?

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

谢谢

推荐答案

正如skaffman所说,请使用-where 选项:

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.

这篇关于限制来自mysqldump的记录数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆