I am running phpmyadmin and installed apache server on my personal computer. My problem is that I am trying to set MySQL event_scheduler
to always be enabled even when the server restarts. I was reading that by setting the following command line in the server configuration file (my.cnf
or my.ini
) it should work: event_scheduler=DISABLED
. However, where do I locate this my.cnf
or my.ini
file, and also should the command line be event_scheduler=DISABLED
or event_scheduler=ENABLED
seeing that I want it to always be enabled?
5 Answers
You should set 'ON' value (not ENABLED).
In the configuration file in [mysqld] section specify 'event-scheduler' option (not event_scheduler).
Also, you can start your MySQL server with '--event-scheduler' option, e.g. -
shell> mysqld --event-scheduler=ON
More information - event_scheduler system variable.

- 119,203
- 23
- 166
- 186
-
Could you take a look at this question please I really need some help http://stackoverflow.com/questions/10088948/mysql-event-running-yearly-calculations – dames Apr 10 '12 at 13:50
-
1Add event_scheduler=ON in your /etc/my.cnf file, in [mysqld] section. (Yes, it's "event_scheduler", not "event-scheduler" :D ) Read more at http://dev.mysql.com/doc/refman/5.1/en/events-configuration.html#events-event-scheduler-option – Cristian Ciocău Aug 06 '13 at 08:08
Add to my.cnf file to [mysqld] section.
GLOBAL event_scheduler=ON
Restart your mysql server. Check status with this command :
mysql> select @@GLOBAL.event_scheduler;
+--------------------------+
| @@GLOBAL.event_scheduler |
+--------------------------+
| ON |
+--------------------------+
1 row in set (0.00 sec)
mysql> SHOW VARIABLES LIKE 'event_scheduler';
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| event_scheduler | ON |
+-----------------+-------+
1 row in set (0.01 sec)
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

- 25,102
- 20
- 116
- 151

- 169
- 1
- 9
For WAMP:
Edit your my.ini file and under the [mysqld] section, add this:
event-scheduler=on
restart all services
verify by running this query:
select @@event_scheduler
;
To get to your my.ini file, just click the WAMP tray icon and hover over the 'MySQL' menu, and click 'my.ini'.
FOR MAMP on OS X:
the default installation does not include a my.cnf
file so you need to create one and set up your default configuration. Therefore, to enable the the scheduler on an OS X MAMP stack, you need to,
- stop your MySQL server
create a
my.cnf
file in your/Applications/MAMP/conf/
folder, you will need root access to do this (open a terminal window),sudo touch /Applications/MAMP/conf/my.cnf
sudo nano /Applications/MAMP/conf/my.cnf
the 2nd cmd will open the nano editor, paste the following in your file,
[mysqld]
event_scheduler=ON
Save (
^O
) and exit (^X
) the nano editorrestart your MySQL server.

- 2,000
- 27
- 45