Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL event scheduler in XAMPP

According to the MySQL documentation, to enable the event scheduler permanently I have to insert the following line in the my.ini (there is no my.cnf file in the mysql folder in XAMPP) somewhere in the [mysqld] section:

event_scheduler=ON

But this doesn't seem to work. Every time I restart the computer, the event scheduler is set to OFF, and I have to set it to ON manually (using the SET GLOBAL event_scheduler = ON; command).

Does anybody know a solution for this? Thanks :)

like image 303
federico-t Avatar asked Oct 11 '11 14:10

federico-t


2 Answers

Here the path for my.ini on XAMPP

xampp\mysql\bin\my.ini

Open my.ini and add the following
[mysqld]
event_scheduler=ON
then restart mySql service.

To check the status use the below mySql query

SELECT @@event_scheduler

like image 84
Mohan Kumar Avatar answered Oct 29 '22 20:10

Mohan Kumar


The "event_scheduler" with the underscore is the variable name of this option, to turn on the event scheduler in the config file you have to use the correct format with a dash:

event-scheduler=ON

This is a bit confusing as both dash and underscore are used in options in the config file. You should use the server system variables reference when you want to figure out the proper syntax:

http://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_event_scheduler

Also, make sure that the option in the configuration file is defined under the [mysqld] header, and not under [client] or [mysqld_safe], because it's not picked up from those places.

like image 35
Fuu Avatar answered Oct 29 '22 20:10

Fuu