mysql export query result

678 ワード

1 . export by shell 
a.sql
use dbname; SELECT id,iab_num  FROM iab_list ;

 
mysql   -h host -uusername -P3306 -ppassword   dbname     < a.sql  > iab.out

 
refer :
https://stackoverflow.com/questions/356578/how-to-output-mysql-query-results-in-csv-format
https://stackoverflow.com/questions/935556/mysql-dump-by-query
http://www.tech-recipes.com/rx/1475/save-mysql-query-results-into-a-text-or-csv-file/
 
転載先:https://www.cnblogs.com/lavin/p/7350492.html