How to check event scheduler status mysql

天大地大妈咪最大 提交于 2019-11-29 09:16:13

Use SHOW VARIABLES

SHOW VARIABLES
WHERE VARIABLE_NAME = 'event_scheduler'

This should also work:

select @@global.event_scheduler = 'ON' 

That is a little easier to use in a stored procedure, where you might want to know if it is ON before turning it on. Note that I tested this on MySQL 5.7 after turning on Event_Scheduler either with ON or 1. In both cases, querying the variable returns 'ON'.

Also, note the quotes are used for querying, but not for setting the variable. A little mysql weirdness for you.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!