日期:2014-05-16  浏览次数:20811 次

【MYSQL】SET GLOBAL event_scheduler = ON报错
SET GLOBAL event_scheduler = ON;
SET @@global.event_scheduler = ON;
SET GLOBAL event_scheduler = 1; 
SET @@global.event_scheduler = 1;
使用上面任何一句都没有用,在my.ini里面的[mysqld] 标记后加一行内容为 event_scheduler = 1也没有作用,错误日志里面也没有显示,只显示了程序非正常重启。mysql的版本是5.1.6的。谁能指点我啊!

------解决方案--------------------
重新启动MYSQL服务,再执行
SET GLOBAL event_scheduler = 1
提示什么

SHOW VARIABLES LIKE 'event_scheduler';
------解决方案--------------------
SQL code
-- 是不是 delimiter 没有设置成分号呢,先执行 delimiter ,再去执行你的语句试试:
mysql-[lym]> delimiter ;
mysql-[lym]> SET GLOBAL event_scheduler = ON;
Query OK, 0 rows affected (0.00 sec)

mysql-[lym]> SET @@global.event_scheduler = ON;
Query OK, 0 rows affected (0.00 sec)

mysql-[lym]> SET GLOBAL event_scheduler = 1;
Query OK, 0 rows affected (0.00 sec)

mysql-[lym]> SET @@global.event_scheduler = 1;
Query OK, 0 rows affected (0.00 sec)

------解决方案--------------------
重新下个MYSQL 5.5安装试试,估计版本有问题
------解决方案--------------------
SQL code
mysql-[lym]> delimiter ;
mysql-[lym]> SHOW VARIABLES LIKE '%sche%';
+-----------------+-------+
| Variable_name   | Value |
+-----------------+-------+
| event_scheduler | ON    |
+-----------------+-------+
1 row in set (0.00 sec)

mysql-[lym]> SET @@global.event_scheduler = 0;
Query OK, 0 rows affected (0.00 sec)

mysql-[lym]> SHOW VARIABLES LIKE '%sche%';
+-----------------+-------+
| Variable_name   | Value |
+-----------------+-------+
| event_scheduler | OFF   |
+-----------------+-------+
1 row in set (0.00 sec)

mysql-[lym]> SET @@global.event_scheduler = 1;
Query OK, 0 rows affected (0.00 sec)

mysql-[lym]> SHOW VARIABLES LIKE '%sche%';
+-----------------+-------+
| Variable_name   | Value |
+-----------------+-------+
| event_scheduler | ON    |
+-----------------+-------+
1 row in set (0.00 sec)

------解决方案--------------------
mysql> set global event_scheduler=1;
Query OK, 0 rows affected (0.00 sec)
------解决方案--------------------
引用SET GLOBAL event_scheduler = ON;
SET @@global.event_scheduler = ON;
SET GLOBAL event_scheduler = 1;
SET @@global.event_scheduler = 1;
使用上面任何一句都没有用,

------解决方案--------------------
这个问题我也碰到过,有些mysql好象没有event_scheduler 这个系统变量