mysqldude
Error codes › 1227

MySQL & MariaDB error 1227: Access denied; you need (at least one of) the SUPER privilege(s)

Error messageAccess denied; you need (at least one of) the … privilege(s) for this operation
Example from our test runs: Access denied; you need (at least one of) the SUPER or SET_ANY_DEFINER privilege(s) for this operation (8.4.13)

The statement needs an administrative privilege the account doesn't have, for example to change a global variable, set another user as DEFINER, or read/write files. MySQL 8.0 split SUPER into finer dynamic privileges.

MySQLMariaDB
SymbolER_SPECIFIC_ACCESS_DENIED_ERRORER_SPECIFIC_ACCESS_DENIED_ERROR
SQLSTATE4200042000
TypeServer errorServer error
Versionsevery release since 5.0 activeevery release since 5.5 active

What it means

Access denied; you need (at least one of) the SUPER or SYSTEM_VARIABLES_ADMIN privilege(s) for this operation. The message lists the privileges that would allow it. MySQL 8.0 replaced most uses of SUPER with dynamic privileges (SYSTEM_VARIABLES_ADMIN, SET_USER_ID / SET_ANY_DEFINER, BINLOG_ADMIN, CONNECTION_ADMIN …). MariaDB has its own split (10.5+: READ_ONLY ADMIN, BINLOG ADMIN, SET USER …).

Why it happens

  • SET GLOBAL … by an ordinary user.
  • Restoring a dump on managed hosting (Amazon RDS, Aurora, Azure, Cloud SQL): the dump contains DEFINER= clauses naming another user, or SET @@GLOBAL.GTID_PURGED / SET @@SESSION.SQL_LOG_BIN. The cloud admin account isn’t a real SUPER user.
  • SELECT … INTO OUTFILE / LOAD DATA INFILE without the FILE privilege: 1227 on MySQL 8.0+ and MariaDB (5.x reported it as the misleading 1045).
  • KILL of another user’s connection, CHANGE MASTER/CHANGE REPLICATION SOURCE, PURGE BINARY LOGS.

How to fix it

  • Use the session form where it exists: SET SESSION sql_mode = … instead of SET GLOBAL.
  • For dumps: create them with mysqldump --set-gtid-purged=OFF --skip-definer (MySQL Shell util.dumpInstance has compatibility: ["strip_definers"]), or remove DEFINER= with sed before importing.
  • Grant the specific privilege the message names, for example GRANT SYSTEM_VARIABLES_ADMIN ON *.* TO … (MySQL 8.0), rather than SUPER.

Reproduce it yourself

These steps are the exact test our harness runs. Use a scratch server, never production.

  1. Connect with mysql -u root -p and create a scratch database:

    CREATE DATABASE demo;
    USE demo;
  2. Run:

    CREATE USER 'appuser'@'%' IDENTIFIED BY 'Test#1234';
  3. In a shell on the database host:

    mysql -uappuser -p'Test#1234' -h127.0.0.1 -e 'SET GLOBAL max_connections = 200'

You get: ERROR 1227 (42000) at line 1: Access denied; you need (at least one of) the CONNECTION ADMIN privilege(s) for this operation(11.8.9)

Verified fixes

  1. Change it for your session only, or have an admin grant the dynamic privilege

    CREATE USER 'appuser'@'%' IDENTIFIED BY 'Test#1234';
    mysql -uappuser -p'Test#1234' -h127.0.0.1 -N -e 'SET SESSION sql_mode = "STRICT_ALL_TABLES"; SELECT @@SESSION.sql_mode'

Tested on

StepMySQLMariaDB
5.65.78.08.4910.610.1111.411.8
An ordinary user changes a global setting
repro
✓ 1227✓ 1227✓ 1227✓ 1227✓ 1227✓ 1227✓ 1227✓ 1227✓ 1227
An ordinary user creates a view with someone else as DEFINER
version check
✓ 1227✓ 1227✓ 1227✓ 1227✓ 1227✓ 1227✓ 1227✓ 1227✓ 1227
Change it for your session only, or have an admin grant the dynamic privilege
fix
✓✓✓✓✓✓✓✓✓
An ordinary user changes a global setting repro
MySQL 5.6✓ 12275.7✓ 12278.0✓ 12278.4✓ 12279✓ 1227
MariaDB 10.6✓ 122710.11✓ 122711.4✓ 122711.8✓ 1227
An ordinary user creates a view with someone else as DEFINER version check
MySQL 5.6✓ 12275.7✓ 12278.0✓ 12278.4✓ 12279✓ 1227
MariaDB 10.6✓ 122710.11✓ 122711.4✓ 122711.8✓ 1227
Change it for your session only, or have an admin grant the dynamic privilege fix
MySQL 5.6✓5.7✓8.0✓8.4✓9✓
MariaDB 10.6✓10.11✓11.4✓11.8✓
✓works ✓ 1062fails with the error the step demonstrates ⚠works with a warning ≠runs, result differs ✗fails Tested 2026-11-25 on 5.6.51, 5.7.44, 8.0.46, 8.4.13, 9.7.4, 10.6.28, 10.11.19, 11.4.13, 11.8.9

Related errors

  • 1044 ER_DBACCESS_DENIED_ERRORexplained
  • 1142 ER_TABLEACCESS_DENIED_ERRORexplained
  • 1045 ER_ACCESS_DENIED_ERRORexplained
  • 1419 ER_BINLOG_CREATE_ROUTINE_NEED_SUPER

Where this error shows up in our guides

  • OUTFILE required permissions · INTO OUTFILE as a user without FILE privilege (1045 on 5.x, clearer 1227 on 8.0+/MariaDB) MySQL 8.0 8.4 9MariaDB 10.6 10.11 11.4 11.8
How the message changed between versions
MySQL fromSymbolMessage
5.0.96ER_SPECIFIC_ACCESS_DENIED_ERRORAccess denied; you need the %-.128s privilege for this operation
5.5.63ER_SPECIFIC_ACCESS_DENIED_ERRORAccess denied; you need (at least one of) the %-.128s privilege(s) for this operation