Database connection failed
Symptoms
- The application shows "error establishing a database connection" or "access denied for user".
- The site worked before and stopped after a password, host or database change.
- The database exists in the panel, but the application cannot reach it.
Common causes
- The database name, username or password in the application configuration is wrong.
- The database host value is wrong. On shared hosting it is often
localhost, but your panel may show a different value. - The database user was not granted access to the database.
- The database was deleted, renamed or moved during a change.
Safe initial checks
- Find the database settings in the application's configuration file. Do not share the password.
- Compare them with the database name, user and host shown in Databases.
- Check the user's access in the panel, and confirm the user is assigned to the database.
Make a backup of the configuration file before you edit it.
Step-by-step solutions
- Wrong name, user or password. Update the configuration file with the values from the panel. If you do not know the password, reset it in the panel and update the file.
- Wrong host. Use the host value the panel shows for your database.
- User not assigned. Grant the user access to the database in the panel. See Databases.
- Database missing. Restore it from a backup. See Website backups.
How to confirm the issue is fixed
- The application loads its home page and an admin page without the connection error.
When to contact support
Contact support if the values match the panel, the user has access, and the error continues.
Information to include in a support ticket
- The application name and version, and the exact error text.
- The database name and user, but not the password.
Related articles
Last reviewed
2026-10-27
