我尝试创建csv
文件以便在 excel 或 liberoffice calc 中使用它。但我有这个问题。
mysql> SELECT *
FROM formtable
INTO OUTFILE "/tmp/try.csv"
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
ESCAPED BY '"'
LINES TERMINATED BY "\n";
如果我使用这个命令,一切都会顺利进行。但是在服务器端,我认为我没有像 linux 中的 tmp 文件夹那样的 tmp 文件夹。因此,我尝试在下面给出具体路径
mysql> SELECT *
FROM formtable
INTO OUTFILE "/var/www/try.csv"
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
ESCAPED BY '"'
LINES TERMINATED BY "\n";
它给了
ERROR 1 (HY000): Can't create/write to file '/var/www/try.csv' (Errcode: 13)
如果我将路径指定为/home/blah/try.csv
. 你有什么建议吗?