The error message "#1227 - access denied; you need (at least one of) the SUPER, SET USER privilege(s) for this operation" occurs when trying to enable the MySQL Event Scheduler without the required SUPER or SET USER privileges.

Understanding the Issue

The following command requires SUPER or SET USER privileges:

SET GLOBAL event_scheduler = ON;

If your MySQL user lacks these privileges, MySQL denies the request.

Check Your Privileges

Run:

SHOW GRANTS FOR CURRENT_USER;

If the output does not include SUPER or SET USER, you lack the necessary permissions.

Solutions to Enable Event Scheduler

1

Use a Privileged Account

If you have access to a root or admin-level MySQL user, run:

GRANT SUPER, SET USER ON *.* TO 'your_user'@'your_host';
FLUSH PRIVILEGES;

Then enable the event scheduler:

SET GLOBAL event_scheduler = ON;

Note: Some managed hosting providers (e.g., AWS RDS, Google Cloud SQL) do not allow granting SUPER privileges. If you are using managed MySQL, try Option 3.

2

Enable Event Scheduler at Startup

If you do not have SUPER privileges, you can enable the Event Scheduler by modifying the MySQL configuration file.

For Linux/macOS (MySQL/MariaDB Self-Hosted)
  1. Edit the MySQL configuration file:
  2. sudo nano /etc/mysql/my.cnf
  3. Add the following under [mysqld]:
  4. [mysqld]
    event_scheduler=ON
  5. Save and exit (Ctrl + X, then Y).
  6. Restart MySQL:
  7. sudo systemctl restart mysql
For Windows (XAMPP, WAMP, MySQL Server)
  1. Open my.ini (usually located in C:\ProgramData\MySQL\MySQL Server x.x\ or inside your XAMPP/WAMP installation).
  2. Add:
  3. [mysqld]
    event_scheduler=ON
  4. Restart MySQL using the Services Manager (services.msc).
3

Use SESSION-Level Event Scheduler (No SUPER Privileges)

If you cannot modify server settings (e.g., on shared hosting or AWS RDS), you can enable the Event Scheduler for the current session:

SET SESSION event_scheduler = ON;
  • This will only work for the current session.
  • It resets when MySQL restarts.

Verify the Event Scheduler Status

After applying one of the fixes above, check if the Event Scheduler is enabled:

SHOW VARIABLES LIKE 'event_scheduler';

Expected output:

+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| event_scheduler | ON |
+-----------------+-------+

Troubleshooting

Issue Solution
SUPER privileges not available Use Option 2 (edit my.cnf/my.ini) or Option 3 (session-based enabling).
my.cnf/my.ini changes ignored Restart MySQL properly (systemctl restart mysql or services.msc).
Still getting access denied Use SHOW GRANTS FOR CURRENT_USER; to confirm privileges.
  • If you own the server, enable Event Scheduler permanently via my.cnf or my.ini.
  • If you do not have root access, use SET SESSION event_scheduler = ON (temporary).
  • If you can modify user privileges, grant SUPER or SET USER privileges.