Home > Database > Mysql Tutorial > mysql导出到csv文件报错

mysql导出到csv文件报错

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 15:34:03
Original
1708 people have browsed it

select * from students into outfile '/tmp/test.csv' fields terminated by ',' optionally enclosed by '' escaped by '' lines terminated by '\r\n'; 执行后产生错误: ERROR 1 (HY000): Can't create/write to file '/home/trial/yqj/sql/test.csv' (E

 select * from students into outfile '/tmp/test.csv' fields terminated by ',' optionally enclosed by '"' escaped by '"' lines terminated by '\r\n';

执行后产生错误:

ERROR 1 (HY000): Can't create/write to file '/home/trial/yqj/sql/test.csv' (Errcode: 13)

经过网上搜索,原来是权限问题,/home/trial/yqj/sql/整个目录的权限必须都是可写的,后来改成

select * from students into outfile '/tmp/test.csv' fields terminated by ',' optionally enclosed by '"' escaped by '"' lines terminated by '\r\n';就好了

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
MySQL stops process
From 1970-01-01 08:00:00
0
0
0
Error when installing mysql on linux
From 1970-01-01 08:00:00
0
0
0
phpstudy cannot start mysql?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template