MySQL Forums
Forum List  »  Backup

MYSQLDUMP using event scheduler
Posted by: sai thotapalli
Date: December 06, 2017 03:05PM

Hi I am trying to schedule the mysqldump backups of all databases using the event scheduler.
SET GLOBAL event_scheduler = ON;
delimiter |
CREATE EVENT bkuptest
ON SCHEDULE EVERY 1 HOUR
DO BEGIN
mysqldump --uroot --ppasswd --all-databases --events --result-file="/it/dba/mysqlbkup/eventschedulertestdev_mysql%datestr%%timestr%.sql";
END |

delimiter ;

I get the following error when i try to execute the script


ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '--user root --password --all-databases --events --result-file="/it/dms/h' at line 4



Can mysqldump be used in even scheduler i see only sqls can be used ?
what is the correct syntax?
Unfortunately I cannot use cron to schedule jobs.

Options: ReplyQuote


Subject
Views
Written By
Posted
MYSQLDUMP using event scheduler
3309
December 06, 2017 03:05PM
1078
December 06, 2017 03:36PM


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.