首页 > 代码库 > MySql导出数据到csv

MySql导出数据到csv

通过mysql客户端shell连接到服务器,选择使用的数据库,输入sql代码: 

select * from test_info   
into outfile ‘/tmp/test.csv‘   
fields terminated by ‘,‘ optionally enclosed by ‘"‘ escaped by ‘"‘   
lines terminated by ‘\r\n‘;

MySql导出数据到csv