语句
select * from table_name into outfile ’/tmp/xxx.xls’;
错误
如果出现错误:The MySQL server is running with the --secure-file-pri option so it cannot execute this.
在mysql库下执行:
show variables like ‘%secure_file_prive%’;
可以看到mysql有个默认的文件存放地址,使用该地址即可,不建议更改;
如果要更改,在my.ini或者my.cnf中配置secure-file-prive即可,然后重启服务。
乱码问题
将xxx.xls用文本打开,然后另存为xxx.xls,编码选择ANSI,使用excel打开,可以再重新保存一遍。