5

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?

Cleb
  • 25,102
  • 20
  • 116
  • 151
dames
  • 1,421
  • 8
  • 35
  • 55

5 Answers5

8

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.

Devart
  • 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
  • 1
    Add 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
7

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)
Community
  • 1
  • 1
netkiller
  • 21
  • 1
  • 4
4

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
Cleb
  • 25,102
  • 20
  • 116
  • 151
Mohan Kumar
  • 169
  • 1
  • 9
3

For WAMP:

  1. Edit your my.ini file and under the [mysqld] section, add this:

    event-scheduler=on

  2. restart all services

  3. 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'.

Community
  • 1
  • 1
AndrewD
  • 4,924
  • 3
  • 30
  • 32
0

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,

  1. stop your MySQL server
  2. 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

  3. the 2nd cmd will open the nano editor, paste the following in your file,

    [mysqld]

    event_scheduler=ON

  4. Save (^O) and exit (^X) the nano editor

  5. restart your MySQL server.

Aurovrata
  • 2,000
  • 27
  • 45