为什么即使文件不存在,SELECT INTO OUTFILE也会给出文件存在错误? [英] why does SELECT INTO OUTFILE give file exists error even though file does not exist?
本文介绍了为什么即使文件不存在,SELECT INTO OUTFILE也会给出文件存在错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
该文件绝对不存在,但无论如何我都遇到了错误.
The file definitely does not exist, but I am getting an error anyway.
我愿意:
$ rm /tmp/records_materialized_view.txt;
$ mysql ...
> SELECT * FROM records_materialized_view INTO OUTFILE '/tmp/records_materialized_view.txt';
ERROR 1086 (HY000): File '/tmp/records_materialized_view.txt' already exists
推荐答案
SELECT INTO OUTFILE
将结果写入服务器文件.
SELECT INTO OUTFILE
writes results to a server file.
您要检查服务器上文件是否存在吗?
Are you checking for the file existence on server?
如果要选择客户端计算机上的本地文件,只需重定向mysql
输出:
If you want to select into a local file on your client machine, just redirect mysql
output:
mysql mydb < script.sql > /tmp/records_materialized_view.txt
这篇关于为什么即使文件不存在,SELECT INTO OUTFILE也会给出文件存在错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文