MYSQL仅转储某些行 [英] MYSQL Dump only certain rows

查看:82
本文介绍了MYSQL仅转储某些行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试对数据库中的几行进行mysql转储.然后,我可以使用转储将那几行上载到另一个数据库中.我拥有的代码正在运行,但是它会转储所有内容.我怎样才能使mysqldump只转储表的某些行?

I am trying to do a mysql dump of a few rows in my database. I can then use the dump to upload those few rows into another database. The code I have is working, but it dumps everything. How can I get mysqldump to only dump certain rows of a table?

这是我的代码:


mysqldump --opt --user=username --password=password lmhprogram myResumes  --where=date_pulled='2011-05-23' > test.sql

推荐答案

只需修复您的--where选项.它应该是有效的SQL WHERE子句,例如:

Just fix your --where option. It should be a valid SQL WHERE clause, like:

--where="date_pulled='2011-05-23'"

您将列名放在引号之外.

You have the column name outside of the quotes.

这篇关于MYSQL仅转储某些行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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