I'm interested in exporting a mysql select statement into a file on a samba share. Everything works fine until I try to update a file. For example, I have mysql exporting into outfile peachtree.csv and when the data changes I want it to over write the old file with the new data, however, I get the error: ERROR 1086 (HY000): File '/srv/samba/share/peachtree.csv' already exists. Is there an option or switch I can put into the statement to force or make it over write the existing file?
SELECT * FROM peachtree,
INTO OUTFILE '/srv/samba/share/peachtree.csv'
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n';