I have to export the MySQL table data into CSV file for every 5 minutes with same file location and file name. I run the following query to export:
SELECT * INTO OUTFILE ' c:/newfolder/matrix.csv ' FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' FROM tablename
When I export the data, first time it exported correctly, but second time it shows the error "SQL Error(1086) File:' c:/newfolder/matrix.csv ' already exists". I need to overwrite the existing file.
Can any one help to solve this problem?