Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SELECT * INTO OUTFILE fails if file exists

1,579 views
Skip to first unread message

scooper

unread,
Nov 19, 2009, 7:41:47 PM11/19/09
to
Dear Newsgroup

MYSQL won't overwrite an existing OUTFILE.
How can I programmatically delete the OUTFILE?
Is there a way to make the SELECT...OUTFILE overwrite the OUTFILE?
Regards scooper


Andrew C.

unread,
Nov 20, 2009, 3:02:00 AM11/20/09
to

"scooper" <robe...@internode.on.net> wrote in message
news:0315d3c7$0$1361$c3e...@news.astraweb.com...

According to the MySQL online manual (the 'SELECT Syntax' section):

"[The output file] cannot be an existing file, which among other things
prevents files such as /etc/passwd and database tables from being
destroyed."

Whenever I have needed to delete the output file, I've used something other
than MySQL to do it (e.g. PHP). I've assumed that as it's a deliberate
decision not to allow the delete/overwrite in MySQL, there'll be no way
around it other than using something else to do any file deletes you need.

A.


0 new messages