mysql event not running

Discussion in 'MySQL' started by xbat, Dec 4, 2013.

  1. #1
    I created a event in mysql but nothing happens. I set SET GLOBAL event_scheduler = ON; and it is running... I looked in the mysql database under log and it shows nothing.. I'm not even sure where to look.

    
    CREATE EVENT backupdb
    ON SCHEDULE EVERY 1 DAY
    STARTS '2013-01-20 03:15:00'
    DO
    SELECT * INTO OUTFILE '/var/www/html/files/backedup.csv'
    FIELDS TERMINATED BY ','
    ENCLOSED BY '"'
    ESCAPED BY '\\'
    LINES TERMINATED BY '\n'
    FROM database.table;
    Code (markup):

    Any pointers or suggestions would greatly be appreciated.
     
    Solved! View solution.
    xbat, Dec 4, 2013 IP
  2. #2
    I usually do the same via cron in Linux (or scheduled task in Windows):

    mysqldump -u <USER> -p<PASSWORD> dbname > /var/www/html/files/backedup.sql

    If you can't get the MySQL event working, I suggest this method instead. You can also more easily create backup archives this way:

    rm -f /var/www/html/files/backedup.sql.old; cp -a /var/www/html/files/backedup.sql /var/www/html/files/backedup.sql.old; (then insert the msyqldump command at the end) - this will create two copies effectively.
     
    Tier_net, May 21, 2014 IP
  3. xbat

    xbat Well-Known Member

    Messages:
    326
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    105
    #3
    thank you turns out is was just a mistake in my line.
     
    xbat, Jun 6, 2014 IP