mysqlのクエリでcsvファイル出力 mysql> select * into outfile 'ファイル名.csv' fields enclosed by '"' terminated by ',' from テーブル名; で取得可能。