mysql导出某张表的部分数据


 

 

1、使用into outfile '保存到操作系统的外部文件路径'

mysql -uroot -p123456 -hhostname -P3306

select   column_name_list  from table_name where condition  into outfile '/home/glc/tmp/yes.csv';

 

2、使用 mysql  -hXXX  -e "select  column_name_list  from table_name where condition "  > no.csv

 

 

3、使用 mysql  -hXXX   -ss  < my.sql    > no.csv  &

其中my.sql中内容为:use database_glc;select column_name_list  from table_name where condition;

 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM