A database connection error usually means the application cannot log in to its database, cannot reach the database server, or is using the wrong database details. On TekLan shared hosting, check the database and user inside Enhance before editing application code.
Check the Exact Error
First, copy the exact error message and note the URL where it appears. "Error establishing a database connection" in WordPress is different from a Laravel exception, but both point to the same core checks: host, database name, username, password, and permissions.
Check the Database Exists in Enhance
- Log in to web.teklanhosting.co.uk.
- Open the affected website.
- Go to Databases.
- Confirm the expected database exists.
Enhance prefixes database names. Use the full database name shown in Enhance, not just the short name you typed when creating it.
Check the Database User
In the Users section, confirm that the database user exists and has access to the correct database. If the user was recreated, the password in the application config may now be wrong.
Check the Application Config File
Common locations include:
- WordPress:
wp-config.php - Laravel:
.env - Blesta: config files inside the installation directory
- Other PHP apps: usually a
config.php,.env, or similar file
Check these values:
Database host: localhost
Database name: full_prefixed_name
Username: full_prefixed_user
Password: current database user password
Check the Host
For most applications on the same Enhance hosting account, the database host is localhost. Do not use an old remote database host from a previous provider unless the application is deliberately connecting elsewhere.
Check After a Migration
Database connection errors are common after migrations because the old host used different database names, usernames, passwords, or prefixes. After importing a database, update the application configuration to match the new Enhance database details.
Check Logs
If the browser shows a generic error, check website error logs in Enhance. Logs may show whether the problem is authentication, a missing PHP extension, a socket issue, or an application-level configuration error.
Do Not Reset Passwords Blindly
If you reset a database password in Enhance, update the application config immediately. Otherwise you can turn a working site into a broken one. Take a backup before making changes to a live production config file.
Related TekLan Guides
Read Creating and Managing Databases in Enhance, How to Check Website Error Logs in Enhance, and How to Test a Site After Moving Hosts.