Heim  >  Artikel  >  Datenbank  >  MySQL 按条件导出某部分数据

MySQL 按条件导出某部分数据

WBOY
WBOYOriginal
2016-06-07 14:55:042166Durchsuche

想导出某个表中的某些数据,怎么办? 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'
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn