쿼리 결과를 파일로 저장하기 위해서는 into outfile를 사용한다. 파일을 절대경로로 지정 가능하고 data폴더 아래 데이타베이스 폴더아래 생성된다.
mysql>select * into outfile 'filename' from table_name;