The SELECT ... INTO OUTFILE 'file_name' form of SELECT writes the selected rows to a file. The file is created on the server host, so you must have the FILE privilege to use this syntax. The file cannot already exist, which among other things prevents files such as `/etc/passwd' and database tables from being destroyed. The SELECT ... INTO OUTFILE statement is intended primarily to let you very quickly dump a table on the server machine. If you want to create the resulting file on some client host other than the server host, you can't use SELECT ... INTO OUTFILE. In that case, you should instead use some command like mysql -e "SELECT ..." > file_name on the client host to generate the file. SELECT ... INTO OUTFILE is the complement of LOAD DATA INFILE; the syntax for the export_options part of the statement consists of the same FIELDS and LINES clauses that are used with the LOAD DATA INFILE statement. See section 14.1.5 LOAD DATA INFILE Syntax. FIELDS ESCAPED BY controls how to write special characters. If the FIELDS ESCAPED BY character is not empty, it is used to prefix the following characters on output:
mysql -u USER -p Database -e "select * f
mysql -u USER -p Database -e "select * from zip;" > /tmp/zip
^^
SELECT ... INTO OUTFILE 구문이 있긴 한데 이건 ser
SELECT ... INTO OUTFILE 구문이 있긴 한데 이건 serve host 에만 된다고 하네요. outfile 할려면 엑세스 권한도 있어야 하는걸로 알고 있습니다.
screen + vim + ctags 좋아요~
두분 감사합니다.역시나 매뉴얼을 보는게 가장 확실하군요...[
두분 감사합니다.
역시나 매뉴얼을 보는게 가장 확실하군요...
Debian Spirit !!!
댓글 달기