mysql event not querying but is showing that it was exacuted

Discussion in 'MySQL' started by xbat, Feb 25, 2014.

  1. #1
    I have a mysql event not querying but is showing that it was executed. In my process list its showing that is was running.. Any ideas or suggestions on where to look? The server was recently restarted.

    I am running mysql 5.1.69 if that helps any.
     
    xbat, Feb 25, 2014 IP
  2. skible

    skible Member

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    41
    #2
    do this and post the output please:

    $result = mysql_query("YOUR QUERY HERE");
    echo $result;
    PHP:
    Please replace the YOUR QUERY HERE with your query.
     
    skible, Feb 28, 2014 IP
  3. xbat

    xbat Well-Known Member

    Messages:
    326
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    105
    #3
    I tried that and when I run it in mysql I keep getting error 1064
     
    xbat, Mar 3, 2014 IP
  4. skible

    skible Member

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    41
    #4
    Could you show me the script / commands you are trying to run?
     
    skible, Mar 3, 2014 IP
  5. xbat

    xbat Well-Known Member

    Messages:
    326
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    105
    #5
    All my old events stopped running for some reason I had all of them setup like >>>>run_now<<< without a database first. They all seemed to run fine for months then just stopped running. Even with restarts. I am not sure what changed exactly. Any one have any idea where the logs are located so I may check. what I don't understand is what was the cause form them to just stop running the one day.

    DELIMITER //
    CREATE EVENT run_now
    ON SCHEDULE EVERY 24 HOUR
    STARTS '2013-12-12 21:00:00'
    DO
    BEGIN
    UPDATE sometable
    SET number=number +1;
    END //
    DELIMITER
    
    Code (markup):

    I added in the database like this below run_now_two and so far it seems be running so far even with restarts.

    DELIMITER //
    CREATE EVENT run_now_two
    ON SCHEDULE EVERY 24 HOUR
    STARTS '2013-12-12 21:00:00'
    DO
    BEGIN
    UPDATE `test`.`sometable`
    SET number=number +1;
    END //
    DELIMITER
    
    Code (markup):
     
    xbat, Mar 4, 2014 IP