Database Connection Error: How to Fix It (ISPmanager)
The messages "Error establishing a database connection", "Access denied for user" or "Unknown database" all mean the same thing: the site cannot log in to the database with the details stored in its settings.
Where the connection details are
| CMS | File and settings |
|---|---|
| WordPress | wp-config.php: DB_NAME, DB_USER, DB_PASSWORD, DB_HOST |
| Joomla | configuration.php: $db, $user, $password, $host |
| OpenCart | config.php and admin/config.php: DB_DATABASE, DB_USERNAME, DB_PASSWORD |
| Laravel and others | .env: DB_DATABASE, DB_USERNAME, DB_PASSWORD |
The file is in the site folder www/your-domain. You can open it in the File manager.
Check in order
- Database and user names — full names, as in the "Databases" list. A name may include the account prefix, so copy it from the list, not from the creation form.
- Server —
localhost. Do not enter an IP address or the server name. - Password — if you are not sure, set a new one: three dots on the database → "Database users" → change the password. Enter this password in the site's settings file right away.
- The database has a user — "Database users" must include the user named in the settings file.

After moving a site
The database and user names on the new hosting are almost always different from the old ones. Create a database (how to create a database), import the dump into it (database import) and enter the new details in the settings file.
Other causes
- The database is damaged — the site connects but shows table errors: how to repair tables.
- The error is not in the database — if the site shows 500 or a blank page, check the error log: site errors 403, 404, 500, 502, 503, 504.
If everything matches and the error remains, contact support from your client area: include the site and the database name. Do not write the password in the ticket.