Mysql Event Not Working

前端 未结 9 1885
-上瘾入骨i
-上瘾入骨i 2021-01-30 10:46

I have added the following simple test event on my mysql database via phpmyadmin:

CREATE DEFINER=`root`@`localhost` EVENT `my_event` 
ON SCHEDULE EVERY 1 MINUTE          


        
9条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-30 11:08

    If you want your event_scheduler to startup automatically every time mysql server restarts, anywhere under the [mysqld] section of the my.ini or my.cnf file that you find in /etc/mysql you should place

    [mysqld]
    
    # turning on event_scheduler  
    event_scheduler=ON
    

    restart mysql to check if it is running (in command line terminal!)

    sudo service mysql restart
    

    then check your processlist

    SHOW PROCESSLIST
    

    you can check if your events are running by checking the last time they ran

    SELECT * FROM INFORMATION_SCHEMA.events
    

提交回复
热议问题