mysql数据导出
方法一
mysql -h127.0.0.1 -u username -P3306 -p'password' slas -ss -e "select id,content from table;" | sed 's/\t/"\/67"/g;s/^/"/;s/$/"/;s/\n//g' > /data01/tmp/data/t_content.csv
方法二
select id,title INTO OUTFILE '/data01/tmp/data/news_title.csv'
FIELDS TERMINATED BY '/67' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
from t_news_content
where content_segment<>1 and content_segment is not null limit 10\G;
需要打开这个参数
set secure_file_priv ='/data01/tmp/data/';