A database connection error usually means the application has the wrong database name, username, password, or host, or the database user does not have privileges on the target database.
Common symptoms
- Error establishing a database connection
- Access denied for user
- The site fails after a password or migration change
Troubleshooting steps
- Open cPanel and confirm the exact database name and database user, including any required account prefixes.
- Reset the database user's password and update the same value inside the application's configuration file.
- Ensure the user is assigned to the database with the required privileges.
- Verify the application is using the correct database host. Many shared hosting environments expect
localhost. - If the database was imported recently, confirm it contains the expected tables and was not imported into a similarly named database by mistake.
Additional notes
- cPanel prefixes database names and usernames automatically on many hosting plans.
- A successful import does not grant permissions automatically; the database user still must be assigned.
When to contact support
Contact support if the credentials are correct and the database is present but the application still cannot connect.