MySQL ERROR 1044 (42000): Access denied for user to database
The login succeeded, but the user has no privileges on the database you’re using.
Seen on:
MySQL
Meaning
Unlike 1045 (login failed), 1044 means authentication worked but authorization didn’t: no GRANT on that schema.
Common causes
- Privileges not granted on the database
- Typo in database name
- Grant made for a different host entry of the user
⚡ Quick fix
GRANT ALL PRIVILEGES ON dbname.* TO 'user'@'host';- Check
SHOW GRANTS FOR 'user'@'host';
Detailed fix by platform
MySQL
- On shared hosting, add the user to the database in cPanel → MySQL Databases.
How to diagnose
- Grants — SHOW GRANTS for the user
- Database — Name correct?
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026