当前位置:首页 > 数据库 > 正文

mysql导出某张表的部分数据

2020-03-01 数据库

 

 

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 -e "select  column_name_list  from table_name where condition "  > no.csv

温馨提示: 本文由Jm博客推荐,转载请保留链接: https://www.jmwww.net/SQL/21626.html