Home  >  Article  >  Database  >  MySQL 按条件导出某部分数据

MySQL 按条件导出某部分数据

WBOY
WBOYOriginal
2016-06-07 14:55:042170browse

想导出某个表中的某些数据,怎么办? mysqldump MySQL mysqldump -u root -p --no-create-db=TRUE --add-drop-table=FALSE --where="user=128560" 数据库名 表名 --skip-lock-tables data.sql#其中 --where 用来指定查询的条件 SELECT order_id,product_name,

想导出某个表中的某些数据,怎么办?
mysqldump MySQL
mysqldump -u root -p --no-create-db=TRUE --add-drop-table=FALSE --where="user=128560" 数据库名 表名 --skip-lock-tables > data.sql
#其中 --where 用来指定查询的条件
SELECT order_id,product_name,qty FROM orders INTO OUTFILE '/data/data.txt'
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn