MySQL 事件状态变更及配置文件设置
select @@event_scheduler;
show events;
show full events;
show create event event_name;
show processlist;
select * from information_schema.events limit 0,10;
set global event_scheduler = on;-- 开启事件调度器,参数立刻生效
在my.cnf中的[mysqld]配置文件添加:–event_scheduler=on,然后重启mysql。
linux 下修改mysql配置文件
[root@AQH-TL-PLAN-DB etc]# which mysqld
/usr/sbin/mysqld
[root@AQH-TL-PLAN-DB etc]# /usr/sbin/mysqld --verbose --help |grep -A 1 'Default options'
Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf ~/.my.cnf
[root@AQH-TL-PLAN-DB etc]#
如果遇到只读文件,root 用户执行
chmod 777 my.cnf
vim
:wq
chmod 644 my.cnf
service mysqld restart
在登录数据库,查看事件调度器状态