Era Host hosting
EraHost – Free Domain, Cheap Hosting!
Client Area
Support 24/7
Menu

MySQL Error #1227: Access Denied — You Need (at Least One of) the SUPER Privilege(s)

3 min read
18.05.2025

This error occurs when you try to perform an operation in MySQL that requires SUPER privileges, but your user account does not have the necessary permissions. SUPER privileges are typically reserved for database administrators and are required for actions that affect the global state of the database.

MySQL Error 1227 Access Denied SUPER Privilege
ERROR 1227 — you tried to do something only root@localhost can do.

For other MySQL/MariaDB privilege and authentication errors, see Fix MySQL "Authentication failed: native_password" Error, Fix mode-default Error in MySQL/MariaDB, MariaDB Database Limits Management, and Fix MariaDB/MySQL "Maximum Databases" Error.

Common Scenarios That Trigger This Error

1. Enabling the Event Scheduler

Attempting to execute:

SET GLOBAL event_scheduler = ON;

2. Setting Global Variables

Modifying server configuration values, such as:

SET GLOBAL max_connections = 200;

3. Replication Setup

Creating or managing replication users.

4. Stored Procedures/Triggers

Using certain functions in triggers or stored procedures, like:

CREATE TRIGGER ...

Solution Options

Check Your Privileges

Run the following query to see what privileges your user has:

SHOW GRANTS FOR CURRENT_USER;

Example output:

GRANT USAGE ON *.* TO 'user'@'localhost';

GRANT ALL PRIVILEGES ON `database_name`.* TO 'user'@'localhost';

If SUPER is not listed, you lack the necessary privileges.

Request SUPER Privileges

Contact your database administrator or hosting provider to grant your user account SUPER privileges. The administrator can run:

GRANT SUPER ON *.* TO 'your_user'@'your_host';

FLUSH PRIVILEGES;

Use an Account with SUPER Privileges

If you have access to a privileged account, switch to it and perform the operation.

Alternative Solutions

For Event Scheduler Issues

If you cannot enable the Event Scheduler globally, try enabling it for your session:

SET SESSION event_scheduler = ON;

For Variable Modifications

If you are trying to modify a global variable and lack SUPER privileges:

  1. Edit the Configuration File:
    • Add the desired configuration directly to the my.cnf or my.ini file:
    [mysqld]
    
    max_connections = 200
    • Restart MySQL for the changes to take effect:
    sudo systemctl restart mysql
  2. Use a Hosting Control Panel:
    • Many hosting platforms provide a graphical interface to modify global settings.

Use MariaDB Alternative (Dynamic Privileges)

If you are using MariaDB (a MySQL fork), you can use the SET_USER privilege as an alternative to SUPER:

GRANT SET_USER ON *.* TO 'your_user'@'your_host';
Linux VDS
High performance for your projects
  • Root access and flexible setup
  • Control panel
  • NVMe disks
  • DDR5
Linux VDS

Preventive Tips

  1. Use root or an equivalent account only when necessary.
  2. Avoid granting SUPER privileges to accounts used in applications.
  3. Use role-based access control to limit privileges.

The #1227 Access Denied error can be resolved by either obtaining the necessary privileges, using session-level configurations, or modifying the MySQL configuration file. If you lack access to administrative accounts, contact your hosting provider for assistance.

Frequently asked questions
In MySQL 8 the error often names the specific dynamic privilege: `SYSTEM_VARIABLES_ADMIN`, `BINLOG_ADMIN`, `CONNECTION_ADMIN`, etc. SUPER no longer covers all of them. Read the error string carefully — it tells you exactly which `GRANT` to write. For MariaDB pre-10.5 and MySQL pre-8.0, SUPER is the single covering privilege.
Pipe the dump through sed before importing: `sed -E 's/DEFINER=`[^`]+`@`[^`]+`//g' dump.sql > dump_clean.sql`. Or generate the dump without DEFINER from the source: pass `--column-statistics=0 --skip-triggers` then add triggers manually, or use `--single-transaction` and post-process. mysqldump itself has no `--no-definer` flag — sed is the standard fix.
SUPER lets the user kill arbitrary connections, set globally-visible session vars, suppress binlog, and bypass read_only. An app user with SUPER means a compromised app can take down the whole DB. Keep app users at SELECT/INSERT/UPDATE/DELETE on their schema only; reserve SUPER for the DBA account used for migrations.
When binary logging is on, MySQL requires SUPER to create stored functions (because non-deterministic functions can break replication). Setting `log_bin_trust_function_creators = 1` tells MySQL "trust me, my functions are safe" and removes the SUPER requirement. Set in my.cnf and restart, or `SET GLOBAL log_bin_trust_function_creators = 1` if you have SUPER itself.
Related articles
Fixing MySQL Error #1227: Access Denied for Enabling Event Scheduler
Fixing session_start(): Permission Denied (13) in XAMPP — System Administrator's Guide
WordPress: Server Doesn't Have ImageMagick or GD Installed/Enabled