备份文件,当前时间戳为文件名

时间:2017-08-02 04:44:02

标签: mysql

我想用currenttimestamp命名我的自动备份文件作为文件名 我有一个程序

drop procedure if exists backup1;
DELIMITER $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `backup1`()
BEGIN
select * from employee_master
INTO outfile 'C://auto_backup/current_timestamp.csv'
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
ESCAPED BY '\\'
LINES TERMINATED BY '\n';
END

这是我的活动

drop event if exists backup_file;
set global event_scheduler=on;
CREATE EVENT backup_file
ON SCHEDULE
every 10 second
DO CALL backup1;

有人帮我解决这个问题

0 个答案:

没有答案