1044 🐬 MySQL

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

  1. GRANT ALL PRIVILEGES ON dbname.* TO 'user'@'host';
  2. Check SHOW GRANTS FOR 'user'@'host';

Detailed fix by platform

MySQL

  1. On shared hosting, add the user to the database in cPanel → MySQL Databases.

How to diagnose

  1. Grants — SHOW GRANTS for the user
  2. 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.