1044: Access denied for user to database
MySQLWhat does it mean?
Although the user authenticated correctly, it does not have privileges to operate on the specified database.
Why does it happen?
No GRANT on the database for the user, a wrong database name, the privilege defined for a different host (user@host) or a non-existent database.
How to fix it
View the user's privileges: SHOW GRANTS FOR 'app_user'@'host'. Grant the required privilege: GRANT ALL PRIVILEGES ON mydb.* TO 'app_user'@'host'; (GRANT takes effect immediately, FLUSH PRIVILEGES is not needed). Verify the correct host match and database name. Following the principle of least privilege, grant only the rights that are needed.
More from this engine
- 1451Cannot delete or update a parent row: a foreign key constraint fails
- 1452Cannot add or update a child row: a foreign key constraint fails
- 1366Incorrect string/integer value for column
- 1264Out of range value for column
- 1052Column 'x' in field list is ambiguous
- 1136Column count doesn't match value count
- 1048Column 'x' cannot be null