MySQL Forums
Forum List  »  Backup

automated database backup
Posted by: Hansy Kumaralal
Date: August 12, 2015 08:53PM

Hi!! I'm assigned with a task of creating an automated backup for a database. I used a PHP event and I want to save my all my backups by a unique name. So I used a date_format and following is my code.

SELECT * FROM redcap_data ;
OUTFILE ' ", DATE_FORMAT(now(),'%Y%m%d_%H%i'),".csv';
FIELDS TERMINATED BY ',' ;
OPTIONALLY ENCLOSED BY '"';
LINES TERMINATED BY "\n";

But it gives an error saying, there is an error in your SQL syntax; near 'OUTFILE ', DATE_FORMAT(now(),'%Y%m%d_%H%i'), .csv''

please help me to find where my error is.

Options: ReplyQuote


Subject
Views
Written By
Posted
automated database backup
2239
August 12, 2015 08:53PM
1236
August 19, 2015 01:41PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.