mysql 결과 텍스트로 저장(리다이렉션)

mysql -u 유저명 -p DB명 -e "쿼리" -t > 저장할 파일명

예)
userid: root
database: user_db
table: user_table
이라고 할때

mysql -u root -p user_db -e "select * from user_table" -t > file.txt

-t 옵션을 뺄 경우 각 필드가 탭으로 구분되어서 저장된다.
top
Tag


http://www.joon.pe.kr/blog/trackback/326


<< Prev   1   ... 17   18   19   20   21   22   23   24   25   ... 334   Next >>