Access denied; you need SUPER privilege for this operation
Production Risk
HIGH — blocks operations critical to replication, backup, and configuration management.
Error 1227 (SQLSTATE 42000) is returned when a statement requires a privilege that the current user does not hold — most commonly SUPER, but also REPLICATION CLIENT, REPLICATION SLAVE, RELOAD, or SYSTEM_VARIABLES_ADMIN depending on the operation.
- 1SET GLOBAL requires SUPER or SYSTEM_VARIABLES_ADMIN (MySQL 8.0+)
- 2Creating stored routines with DEFINER requires SUPER if the definer is not the current user
- 3CHANGE MASTER / STOP SLAVE requires REPLICATION CLIENT or SUPER
- 4KILL CONNECTION requires SUPER for killing other users' connections
- 5Importing a mysqldump that contains DEFINER clauses without SUPER privilege
Setting a global variable without SUPER privilege.
SET GLOBAL slow_query_log = ON; -- Current user lacks SUPER or SYSTEM_VARIABLES_ADMIN
expected output
ERROR 1227 (42000): Access denied; you need (at least one of) the SUPER or SYSTEM_VARIABLES_ADMIN privilege(s) for this operation
Fix 1
Grant the required privilege
WHEN When the operation is legitimate and the user needs ongoing access.
-- Grant SUPER (broad — use narrower privileges in MySQL 8+): GRANT SUPER ON *.* TO 'appuser'@'localhost'; -- In MySQL 8.0+ prefer: GRANT SYSTEM_VARIABLES_ADMIN ON *.* TO 'appuser'@'localhost';
Why this works
MySQL 8.0 split SUPER into fine-grained dynamic privileges. Use the narrowest privilege that satisfies the requirement.
Fix 2
Strip DEFINER clauses when importing a dump
WHEN When importing a mysqldump that fails due to DEFINER.
-- Strip DEFINER from dump before importing: sed 's/DEFINER=[^ ]*//' dump.sql | mysql -u appuser -p mydb
Why this works
Without DEFINER, routines and views are created with the importing user as definer, requiring no SUPER privilege.
✕ Grant SUPER to application users
SUPER grants the ability to bypass many security controls; use narrower privileges instead.
SUPER is deprecated in favour of fine-grained dynamic privileges (SYSTEM_VARIABLES_ADMIN, REPLICATION_SLAVE_ADMIN, etc.).
SUPER is retained but MariaDB also adds fine-grained privilege roles.
MariaDB Server error code 1227 / ER_SPECIFIC_ACCESS_DENIED_ERROR
MariaDB GRANT Global Privileges ↗MySQL 8.0 Dynamic Privileges ↗Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev