#mysql -uroot -p123 -Dcrawl
#select bids_company_view.company_name,bids_company_view.url,company.city,company.province from bids_company_view left join company on bids_company_view.id = company.id limit 10
into OUTFILE '/home/mysql/mysql_out.txt'
CHARACTER set utf8;
into OUTFILE '/home/mysql/mysql_out.txt'
CHARACTER set utf8;
若报错: Can't create/write to file 'root/111' (Errcode: 13)
说明没有输出文件所在目录的权限
查看 /etc/passwd 可看到 MySQL 默认目录路径 默认为/home/mysql
若不存在则新建此文件夹 将此目录所有者改成 mysql
#chown mysql mysql
然后重新运行sql把文件导出到此目录下即可