怎么能够在My.ini里面设置SET GLOBAL event_scheduler = 1;
让Event能够自动执行

解决方案 »

  1.   

    [mysqld]# The TCP/IP Port the MySQL Server will listen on
    port=3306
    general_log=1
    general_log_file="C:\\Documents and Settings\\All Users\\Application Data\\MySQL\\MySQL Server 5.1\\data\\tigerstone-05.log"
    log_bin="C:\\Documents and Settings\\All Users\\Application Data\\MySQL\\MySQL Server 5.1\\Data\\tigerstone-05-logbin"
    slow_query_log=1
    slow_query_log_file= "C:\\Documents and Settings\\All Users\\Application Data\\MySQL\\MySQL Server 5.1\\Data\\tigerstone-05-slow.log"
    event_scheduler = 1
      

  2.   

    加在你的my.ini 的 [mysqld} 节中
    event_scheduler=ON
    event_scheduler Version Introduced 5.1.6 
    Command Line Format --event-scheduler[=value] 
    Config File Format event-scheduler 
    Option Sets Variable Yes, event_scheduler 
    Variable Name event_scheduler 
    Variable Scope Global 
    Dynamic Variable Yes 
    Value Set  Type enumeration 
    Default OFF 
    Valid Values ON, OFF, DISABLED 
     This variable indicates the status of the Event Scheduler; as of MySQL 5.1.12, possible values are ON, OFF, and DISABLED, with the default being OFF. This variable and its effects on the Event Scheduler's operation are discussed in greater detail in the Overview section of the Events chapter. This variable was added in MySQL 5.1.6. 
      

  3.   

    记得重启服务
    mysql> show global variables like "event_scheduler";
    +-----------------+-------+
    | Variable_name   | Value |
    +-----------------+-------+
    | event_scheduler | ON    |
    +-----------------+-------+
    1 row in set (0.00 sec)
      

  4.   

    谢谢了。查了好久没搞出来。自己在my.ini 中加了,没加对地方,启动不了,到这一看是地方错了,呵呵