RDS MySQL "ERROR 1227: Access Denied; You Need (at Least One of) the SUPER Privilege(s)": Fix mysqldump Imports, DEFINER, ERROR 1419 and ERROR 1449
ERROR 1227 (42000): Access denied; you need (at least one of) the SUPER privilege(s) on Amazon RDS for MySQL means a statement needs a privilege that RDS never gives anyone, not even the master user. It almost always appears while you import a mysqldump file, and the cause is a few lines that mysqldump writes into the file, not your data. The fix: dump again with --set-gtid-purged=OFF, strip the DEFINER= clauses with one sed command, and set log_bin_trust_function_creators to 1 in a custom parameter group, and the import goes through. Here's the part that surprises people: the import usually fails on line 18, before a single table exists, because mysqldump puts SET @@SESSION.SQL_LOG_BIN= 0; near the top of the file, and turning off binary logging is one of the things RDS doesn't allow. This page decodes every variant of the error, including the related ERROR 1419 for triggers and the ERROR 1449 that can appear after an import that looked successful.
Ethan, a developer, was moving the database behind his friend Jake's phone repair shop, repairs, bookings and all, from an old server to Amazon RDS. The dump came out fine. The import stopped after one second with ERROR 1227, and the shop's database on RDS was still empty.
New to RDS? Amazon RDS runs MySQL and other databases for you: AWS handles the server, backups and patching, and in exchange, you don't get full control of the database server.
What ERROR 1227 means on RDS
MySQL's SUPER privilege, and the newer fine-grained privileges that replace it, let an account change server-wide settings, turn off binary logging and create objects owned by other accounts. On your own server, the root account has all of them. On RDS, nobody does. The master user you created with the database gets a long list of privileges, but not SUPER, because AWS keeps the server-level controls for itself. From RDS for MySQL 8.0.36, those privileges come through a role named rds_superuser_role, which, despite the name, still doesn't include SUPER.
A second fact makes this worse on RDS: when automated backups are on, which they are by default, binary logging is on. With binary logging on, MySQL is stricter about who may create triggers and functions, which is where ERROR 1419 comes from. So a dump that imports cleanly as root on a server without binary logging can fail several different ways on RDS.
Jake: "So the master account isn't really the master?"
Ethan: "Master of the database. Not of the server it runs on. AWS keeps the keys to that."
Which line failed? The error decoder
The error message names the privilege it wanted, and that tells you which kind of line failed. These are the exact messages from MySQL 8.4 and 8.0, the versions RDS runs today:
| Error says it needs | The line that failed | Fix |
|---|---|---|
| SUPER, SYSTEM_VARIABLES_ADMIN or SESSION_VARIABLES_ADMIN | SET @@SESSION.SQL_LOG_BIN= 0; near the top of the dump | Dump with --set-gtid-purged=OFF |
| SUPER or SYSTEM_VARIABLES_ADMIN | SET @@GLOBAL.GTID_PURGED=... | Dump with --set-gtid-purged=OFF |
| SUPER or SET_ANY_DEFINER (MySQL 8.4) | A view, trigger, function or procedure with DEFINER= another account | Strip or rewrite the DEFINER clauses |
| SUPER or SET_USER_ID (MySQL 8.0) | The same DEFINER clauses | Strip or rewrite the DEFINER clauses |
| SYSTEM_USER (MySQL 8.0) | A DEFINER that names a system account, such as root, that exists on the target | Strip or rewrite the DEFINER clauses |
| ERROR 1419: "You do not have the SUPER privilege and binary logging is enabled" | A trigger or function | log_bin_trust_function_creators = 1 |
| ERROR 1449: "The user specified as a definer does not exist" | Not the import: running a view, trigger or routine afterward | Create the missing account, or recreate the object |
The import stops at the first error, so you see one line at a time. Fix the dump file for every row in this table at once, and you avoid importing four times.
Why the import dies on line 18
Here's what Ethan saw, importing a default mysqldump file into RDS:
mysql -h shop-db.c1abcdexample.us-east-1.rds.amazonaws.com -u admin -p < dump.sql
ERROR 1227 (42000) at line 18: Access denied; you need (at least one of) the SUPER, SYSTEM_VARIABLES_ADMIN or SESSION_VARIABLES_ADMIN privilege(s) for this operation
Line 18 isn't data. mysqldump writes these lines into the file when the source server uses GTIDs, the global transaction IDs that MySQL replication uses:
grep -n "SQL_LOG_BIN" dump.sql
17:SET @MYSQLDUMP_TEMP_LOG_BIN = @@SESSION.SQL_LOG_BIN;
18:SET @@SESSION.SQL_LOG_BIN= 0;
174:SET @@SESSION.SQL_LOG_BIN = @MYSQLDUMP_TEMP_LOG_BIN;
Line 18 turns off binary logging for the import session, and a few lines later, the file sets @@GLOBAL.GTID_PURGED to the source server's transaction history. Both are meant for building a replica of the source server, and both need privileges the RDS master user doesn't have. For a plain copy of your data, you don't want either of them.
The clean fix: dump again with --set-gtid-purged=OFF
The option that leaves those lines out is --set-gtid-purged=OFF. Dump the database again with it, and add the options that bring along everything a real application database has:
mysqldump -h old-server -u root -p \
--set-gtid-purged=OFF --single-transaction \
--routines --triggers --events \
--databases shop > dump.sql
What each option does:
--set-gtid-purged=OFFleaves out theSQL_LOG_BINandGTID_PURGEDlines.--single-transactiontakes a consistent copy of InnoDB tables without locking them while the dump runs.--routinesand--eventsinclude stored functions, procedures and scheduled events, whichmysqldumpleaves out unless asked. Triggers are included by default;--triggersjust makes that explicit.--databases shopadds theCREATE DATABASEandUSElines, so the import creates the database for you.
Check the new file: the count should be zero.
grep -c "SQL_LOG_BIN\|GTID_PURGED" dump.sql
0
If you can't dump again, for example because the old server is gone, delete those lines from the file instead: the two SQL_LOG_BIN lines at the top and bottom, and the GTID_PURGED statement.
DEFINER clauses: strip them with one sed command
Every view, trigger, function and procedure in MySQL has an owner, its definer, and mysqldump writes it into the file: DEFINER=`root`@`localhost`. Creating an object on behalf of another account needs SET_ANY_DEFINER on MySQL 8.4 or SET_USER_ID on 8.0, plus SYSTEM_USER if that account is a system account. Count them first:
grep -c 'DEFINER=' dump.sql
4
Then remove them. Without a DEFINER clause, each object belongs to the account that runs the import, which is what you want on RDS:
sed -i -e 's/DEFINER=`[^`]*`@`[^`]*`//g' dump.sql
That command is for Linux, CloudShell and WSL. On a Mac, the built-in sed needs an empty argument after -i: sed -i '' -e '...' dump.sql. To keep a specific owner instead of the importing account, replace rather than delete, for example DEFINER=`root`@`localhost` to DEFINER=`admin`@`%`, where admin is your RDS master user.
Views keep their SQL SECURITY DEFINER setting after the clause is removed; they simply run with the new owner's privileges.
Jake: "So every saved report in my database was signed by the old server?"
Ethan: "His server's root account, on every trigger and view. RDS won't let me sign things in a name that isn't mine."
ERROR 1419 on triggers and functions: log_bin_trust_function_creators
With the DEFINER clauses gone, a dump with triggers or functions can still stop here:
ERROR 1419 (HY000) at line 97: You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
Because binary logging is on, MySQL only lets an account without SUPER create triggers and functions when log_bin_trust_function_creators is 1. On RDS you can't change it with SET GLOBAL; you change it in a DB parameter group. The default parameter group can't be edited, so create your own. First, find the parameter group family for your instance's MySQL version:
aws rds describe-db-instances --db-instance-identifier shop-db \
--query "DBInstances[0].[EngineVersion,DBParameterGroups[0].DBParameterGroupName]" --output text
aws rds describe-db-engine-versions --engine mysql --engine-version 8.4.7 \
--query "DBEngineVersions[0].DBParameterGroupFamily" --output text
Use the version the first command prints in the second one. Then create the group with that family, set the parameter, attach the group and reboot:
aws rds create-db-parameter-group --db-parameter-group-name shop-mysql \
--db-parameter-group-family mysql8.4 \
--description "shop: allow triggers and functions with binary logging"
aws rds modify-db-parameter-group --db-parameter-group-name shop-mysql \
--parameters "ParameterName=log_bin_trust_function_creators,ParameterValue=1,ApplyMethod=immediate"
aws rds modify-db-instance --db-instance-identifier shop-db \
--db-parameter-group-name shop-mysql --apply-immediately
aws rds reboot-db-instance --db-instance-identifier shop-db
Replace mysql8.4 with the family the lookup printed. The reboot is needed once, to attach a new parameter group. After that, log_bin_trust_function_creators is a dynamic parameter: later changes to it apply without a reboot. Check it from MySQL after the reboot:
SHOW VARIABLES LIKE 'log_bin_trust_function_creators';
+---------------------------------+-------+
| Variable_name | Value |
+---------------------------------+-------+
| log_bin_trust_function_creators | ON |
+---------------------------------+-------+
The name includes "less safe" for a reason: it lets non-deterministic functions be written to the binary log. For moving an application database onto RDS, it's the standard setting. If the instance seems stuck after modify-db-instance, our guide to RDS stuck in "modifying" explains what it's waiting for.
ERROR 1449 after an import that looked successful
There's one more way this goes wrong, and it's the sneakiest. On RDS for MySQL 8.0.36 and later 8.0 versions, the master user has SET_USER_ID, so a dump with DEFINER=`olddev`@`10.0.%`, an account from the old server, can import with no error at all. Then the application calls a function:
ERROR 1449 (HY000) at line 1: The user specified as a definer ('olddev'@'10.0.%') does not exist
The objects were created, owned by an account that doesn't exist on RDS, and they fail when used. A view in the same state can even fail with ERROR 1045 Access denied for user ... (using password: YES), which sends people off to reset passwords that were never wrong. This query lists every object and its owner, so you can spot accounts that don't exist:
SELECT 'routine' AS kind, ROUTINE_SCHEMA AS db, ROUTINE_NAME AS name, DEFINER FROM information_schema.ROUTINES WHERE ROUTINE_SCHEMA NOT IN ('mysql','sys')
UNION ALL SELECT 'trigger', TRIGGER_SCHEMA, TRIGGER_NAME, DEFINER FROM information_schema.TRIGGERS WHERE TRIGGER_SCHEMA NOT IN ('mysql','sys')
UNION ALL SELECT 'view', TABLE_SCHEMA, TABLE_NAME, DEFINER FROM information_schema.VIEWS WHERE TABLE_SCHEMA NOT IN ('mysql','sys')
UNION ALL SELECT 'event', EVENT_SCHEMA, EVENT_NAME, DEFINER FROM information_schema.EVENTS;
+---------+------+---------------+---------------+
| kind | db | name | DEFINER |
+---------+------+---------------+---------------+
| routine | shop | with_tax | olddev@10.0.% |
| routine | shop | reprice | olddev@10.0.% |
| trigger | shop | repairs_touch | olddev@10.0.% |
| view | shop | open_repairs | olddev@10.0.% |
+---------+------+---------------+---------------+
The cleanest fix is to drop the database, strip the DEFINER clauses from the dump and import again. If you can't, create the missing account, locked so nobody can sign in with it, and give it the privileges its objects use:
CREATE USER 'olddev'@'10.0.%' ACCOUNT LOCK;
GRANT SELECT, INSERT, UPDATE, DELETE, EXECUTE, TRIGGER ON shop.* TO 'olddev'@'10.0.%';
The TRIGGER privilege matters: without it, the function and the view work again, but every UPDATE that fires the trigger fails with ERROR 1142 (42000): TRIGGER command denied to user 'olddev'@'10.0.%'.
Other things that need SUPER on RDS
Imports cause most ERROR 1227 reports, but a few everyday admin commands hit the same wall. Each has an RDS way of doing it:
| On your own server | On RDS |
|---|---|
SET GLOBAL some_setting = ... | Change the setting in your custom DB parameter group, as above |
KILL 1234; on another account's connection | CALL mysql.rds_kill(1234); to end the connection |
KILL QUERY 1234; | CALL mysql.rds_kill_query(1234); to stop only the running query |
INSERT INTO mysql.user ... to create accounts | CREATE USER and GRANT; from RDS for MySQL 8.0.36, the mysql tables can't be changed directly |
GRANT SUPER ON *.* TO ... | Not possible for any account; use the replacements in this table |
If you're ending connections because there are too many of them, our "Too many connections" guide fixes the cause instead.
The RDS MySQL import checklist
Put together, this is the order that gets a MySQL database onto RDS in one import:
- Create a custom parameter group with
log_bin_trust_function_creators = 1, attach it and reboot, before the import. - Dump with
--set-gtid-purged=OFF --single-transaction --routines --triggers --events. - Check:
grep -c "SQL_LOG_BIN\|GTID_PURGED" dump.sqlprints 0. - Strip the DEFINER clauses with the
sedcommand, and check thatgrep -c 'DEFINER=' dump.sqlprints 0. - Import with the master user, without
--force, so the first problem stops it. - Run the DEFINER query to confirm every object belongs to an account that exists.
- Create your application's own MySQL user with only the privileges it needs, and keep its password in Secrets Manager, not in the code.
If an import stopped halfway, drop the half-created database before you try again, so you start from a clean state.
Jake: "And the bookings are all there?"
Ethan: "All of them, and the price trigger fires. The dump was fine all along. It was the instructions printed at the top of it."
Troubleshooting by symptom
ERROR 1227 at line 18 or line 24
The dump contains SQL_LOG_BIN or GTID_PURGED lines. Dump again with --set-gtid-purged=OFF, or delete those lines.
ERROR 1227 ... SET_ANY_DEFINER or SET_USER_ID
A DEFINER clause names another account. Strip the DEFINER clauses with sed, then import again.
ERROR 1227 ... SYSTEM_USER
A DEFINER names a system account such as root. Strip or rewrite the DEFINER clauses.
ERROR 1419 when creating a trigger or function
Set log_bin_trust_function_creators to 1 in a custom DB parameter group attached to the instance.
ERROR 1449: The user specified as a definer does not exist
An object belongs to an account that isn't on RDS. Recreate it without a DEFINER, or create that account, locked.
ERROR 1045 Access denied when selecting from a view
If the password is right, check the view's DEFINER. An owner account that doesn't exist can cause it.
SET GLOBAL fails with ERROR 1227
Change the setting in a custom DB parameter group instead of with SET GLOBAL.
RDS MySQL ERROR 1227 and SUPER: frequently asked questions
What does ERROR 1227 (42000) Access denied; you need the SUPER privilege mean?
The statement needs a privilege the account doesn't have. On RDS, no account has SUPER, so the statement must be changed or removed.
Can I get the SUPER privilege on Amazon RDS for MySQL?
No. RDS doesn't give SUPER to any account, including the master user. Use parameter groups and RDS stored procedures instead.
How do I import a mysqldump file into RDS without ERROR 1227?
Dump with --set-gtid-purged=OFF, strip the DEFINER clauses with sed, and set log_bin_trust_function_creators to 1 in a parameter group.
What does --set-gtid-purged=OFF do?
It tells mysqldump not to write the SQL_LOG_BIN and GTID_PURGED lines, which need privileges RDS doesn't grant.
How do I remove DEFINER from a mysqldump file?
Run sed -i -e 's/DEFINER=`[^`]*`@`[^`]*`//g' dump.sql on Linux. On a Mac, add '' after -i.
Why does my RDS import fail at line 18?
Line 18 of a mysqldump file is often SET @@SESSION.SQL_LOG_BIN= 0, which needs SUPER or SYSTEM_VARIABLES_ADMIN.
How do I fix ERROR 1419 on Amazon RDS?
Create a custom DB parameter group, set log_bin_trust_function_creators to 1, attach it to the instance and reboot once.
Why is binary logging on for my RDS instance?
Automated backups turn on binary logging. They're on by default, so most RDS for MySQL instances have binary logging enabled.
What does ERROR 1449 The user specified as a definer does not exist mean?
A view, trigger or routine belongs to an account that doesn't exist on this server. Recreate it without a DEFINER, or create the account.
Does log_bin_trust_function_creators need a reboot on RDS?
Changing it in a parameter group already attached to the instance doesn't. Attaching a new parameter group needs one reboot.
Can I change the default parameter group on RDS?
No. Default parameter groups can't be edited. Create a custom group, change the parameter there, and attach it.
What privileges does the RDS for MySQL master user have?
Most database privileges, through rds_superuser_role from version 8.0.36, but not SUPER or the server-level admin privileges.
How do I kill a query on RDS MySQL without SUPER?
Use CALL mysql.rds_kill_query(processID) to stop a query, or CALL mysql.rds_kill(processID) to end the connection.
Is SET_USER_ID available on RDS for MySQL 8.4?
No. MySQL 8.4 removed SET_USER_ID; its DEFINER errors name SET_ANY_DEFINER instead. Stripping DEFINER clauses works on both versions.
Should I use --force to skip the errors?
No. --force skips the failed statements, so triggers, functions or views can be silently missing. Fix the dump instead.
Which MySQL versions does RDS run?
RDS for MySQL runs 8.4 and 8.0. Version 8.0 reached the end of standard support on July 31, 2026, and is now in Extended Support.
For readers preparing for an AWS certification
We have been covering AWS certifications alongside our fixes, so here is a short extra for readers studying for one. If you only came for the fix, you already have it; feel free to skip this part.
Exams that test this topic: CloudOps Engineer – Associate (SOA-C03) • Developer – Associate (DVA-C03 from December 1, 2026).
Here are the exam-style questions this topic tends to raise, with the reasoning you need to answer them:
1. Why does importing a dump fail with ERROR 1227 (access denied; you need the SUPER privilege)?
The RDS master user does not have SUPER, and the dump contains DEFINER clauses or statements that need it.
2. How do you allow creating stored functions with binary logging on?
Set log_bin_trust_function_creators to 1 in a custom DB parameter group.
3. How do you make a dump portable to RDS?
Remove DEFINER clauses and SET statements that need SUPER, or use flags that skip them.
4. Can you modify the default parameter group?
No. Create a custom parameter group and attach it to the instance.
5. Which RDS procedures replace SUPER-only operations?
Stored procedures such as mysql.rds_kill and mysql.rds_set_configuration.
6. Which service migrates databases with minimal downtime?
AWS Database Migration Service (DMS).
Exam codes and dates change often. Our AWS certification changes page keeps track of what is current.
Ethan dumped the shop database again with --set-gtid-purged=OFF, ran one sed command, and had the parameter group in place before he started. The import ran start to finish without a message. Jake's only question was why it had taken a whole evening the first time. Ethan's answer was the first 24 lines of a text file.
📌 If you keep one line from this page
RDS gives no one SUPER, so dump with --set-gtid-purged=OFF, strip the DEFINER clauses, and set log_bin_trust_function_creators to 1 before you import.
Line 18 = SQL_LOG_BIN · DEFINER = sed · 1419 = parameter group · 1449 = missing owner.
Revision note. Written October 13, 2026, for Amazon RDS for MySQL 8.4 and 8.0. "When you move house, you find out what you own," goes an old saying; moving a database to RDS shows you who owns every trigger in it.