MySQL error 1449: Definer user does not exist
A view, trigger, procedure or event was created with a DEFINER account that no longer exists on this server, so it can't run.
- Error number
1449- Name
ER_NO_SUCH_USER- SQLSTATE
HY000- Category
- Access and privileges
What it means
Stored programs and views run with the privileges of their DEFINER (unless declared SQL SECURITY INVOKER). If that account is missing, for example after a dump from another server, using the object fails with 1449, which names the missing definer.
Common causes
- Restoring a dump whose objects were defined by a user that doesn't exist on the new server.
- Dropping the account that created views or triggers.
How to fix it
-
Find the objects with the missing definer.
SELECT table_name FROM information_schema.views WHERE definer = 'olduser@%'; SELECT trigger_name FROM information_schema.triggers WHERE definer = 'olduser@%'; SELECT routine_name FROM information_schema.routines WHERE definer = 'olduser@%';
-
Create the missing account, or recreate the objects with an existing definer.
CREATE USER 'olduser'@'%' IDENTIFIED BY 'strong-password'; -- or, for a view: ALTER DEFINER = 'app'@'%' VIEW v_orders AS SELECT * FROM orders;
-
When dumping for another server, strip
DEFINERclauses or recreate objects afterwards.
Related errors
1227Access denied; you need a privilege1419SUPER privilege needed with binary logging1396Operation CREATE USER failed
More access and privileges errors
1045Access denied for user1044Access denied for user to database1130Host is not allowed to connect1698Access denied for user (no password)1142Command denied to user for table1143Command denied to user for column
The code and message text are from the MySQL 8.4 Error Message Reference. Browse the full MySQL error list or search every database error.
Work on MySQL in SQLly
A native SQL client for macOS, Windows and Linux with schema-aware IntelliSense, guardrails for risky statements and clear error messages, for MySQL and the other databases you use.