我想将select * from table
结果导出到linux中命令行的文本文件中。我该怎么做?
谢谢, 让
答案 0 :(得分:17)
查看link
您只需将其添加到查询
select * from table INTO OUTFILE '/tmp/myfilename.txt'
你可以将它改进为csv文件(在excel后面使用它)
喜欢:
INTO OUTFILE '/tmp/myfilename.csv'
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n'