How to set global event_scheduler=ON even if MySQL is restarted?

后端 未结 5 444
暖寄归人
暖寄归人 2020-12-14 06:29

I want to set the event_scheduler global to ON even if MySQL is restarted; how can I achieve this?

SET GLOBAL event_scheduler = ON;         


        
5条回答
  •  醉梦人生
    2020-12-14 07:12

    sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf 
    

    Add this line at the end of the file:

    event_scheduler=ON
    

    Than reboot and check if daemon is started after reboot:

    Log into mysql bash:

    mysql -u  -p
    

    Than run the command:

    SHOW PROCESSLIST;
    

    Now you should see the event scheduler daemon in the list

提交回复
热议问题