To permanently enable the MySQL Event Scheduler, you need to modify the MySQL configuration file so that it remains enabled after a server restart.
Check the Current Status
Before making changes, check whether the Event Scheduler is currently enabled:
Expected output if disabled:
| Variable_name | Value |
+-----------------+-------+
| event_scheduler | OFF |
+-----------------+-------+
If the value is OFF, you need to enable it.
Enable Event Scheduler for the Current Session (Temporary)
If you only need to enable the Event Scheduler temporarily (until the MySQL service restarts), run:
- This does not persist after a MySQL restart.
- You need SUPER privileges to execute this command.
Enable Event Scheduler Permanently (Recommended)
To ensure Event Scheduler is always enabled, modify MySQL configuration file.
For Linux / macOS (Self-Hosted MySQL, MariaDB)
Edit MySQL configuration file
For MariaDB, the file may be located at:
Add the following line under [mysqld]
event_scheduler=ON
Save and exit (Ctrl + X, then Y)
Restart MySQL
Verify the status
Expected output:
| Variable_name | Value |
+-----------------+-------+
| event_scheduler | ON |
+-----------------+-------+
For Windows (XAMPP, WAMP, MySQL Server)
Open MySQL configuration file (my.ini)
Typically located at:
Or inside your XAMPP/WAMP installation.
Add this under [mysqld]
event_scheduler=ON
Save the file
Restart MySQL
Open Services Manager (services.msc), find MySQL and click Restart.
Verify using
Expected output:
| Variable_name | Value |
+-----------------+-------+
| event_scheduler | ON |
+-----------------+-------+
Troubleshooting
| Issue | Solution |
|---|---|
| Permission denied while editing my.cnf/my.ini | Use sudo (Linux) or open as Administrator (Windows). |
| event_scheduler resets to OFF after restart | Ensure event_scheduler=ON is inside [mysqld] in my.cnf or my.ini. |
| MySQL does not restart | Check the MySQL error logs (/var/log/mysql/error.log). |
| Access denied: SUPER privilege required | Ask the DB admin to enable event_scheduler or modify my.cnf. |
Alternative: Managed MySQL Services (AWS RDS, Google Cloud)
If you are using a managed MySQL service (e.g., AWS RDS, Google Cloud SQL), you cannot edit my.cnf directly. Instead:
- Use custom parameter groups:
- Go to AWS RDS Console > Parameter Groups.
- Find event_scheduler, set it to ON, and apply it.
- For permanent enabling, edit my.cnf (Linux/macOS) or my.ini (Windows).
- For temporary use, run SET GLOBAL event_scheduler = ON;.
- For managed MySQL services, use a custom parameter group.


