Fill the Server: 80% off your first 4 monthly invoices, monthly billing. Ends Nov 30, 2026. 25 spots in this batch.FILL25
Fill the Server, annual: about 29.63% off your first annual invoice. Ends Nov 30, 2026.FILL25Y
Fill the Server, 2 year term: about 15.69% off your first biennial invoice. Ends Nov 30, 2026.FILL25B
Fill the Server, 3 year term: about 11.11% off your first triennial invoice. Ends Nov 30, 2026.FILL25T
80% off your first 3 months, monthly billing. Ends Dec 25, 2027.3MONTHS80
50% off your first annual Shared term. Ends Dec 31, 2027.50SHARED
Shared Starter, 3 year term: C$105.84 total.MOOSE294
20% off your first 3 monthly VPS invoices. Ends Dec 31, 2027.20VPS3
25% off your first annual base VPS term.25VPS

← All guides

Troubleshooting

Database connection failed: how to check the whole path

Published August 2026 · 8 min read

Applications often reduce a complex database failure to one generic message. Troubleshoot in layers: can the application resolve the host, reach the port, negotiate the required connection, authenticate, and access the expected database?

Confirm the destination is the database you intend to use

Check the configured hostname, port, database name, and environment. Migrations and secrets rotation can leave an application pointing at an old server even while the new database is healthy.

Test network reachability separately from credentials

If the TCP port is unreachable, changing a password will not help. Check service listening state, firewalls, security groups, bind addresses, private network routing, and DNS before authentication.

Then verify authentication and privileges

Confirm the username, password or certificate, source-host restrictions, database grants, and TLS requirements. A user can authenticate successfully but still lack permission for the schema or operation the application needs.

Check capacity when intermittent failures appear

Connection-pool exhaustion, database connection limits, CPU/memory pressure, disk issues, locks, or failovers can make some connections succeed while others fail. Correlate application and database logs with resource data.

Next step

A database connection failure can involve DNS, host, port, firewall, service state, TLS, credentials, privileges, connection limits, or application configuration.

Explore VPS hosting

Keep reading

Related guides.

HTTP 500, 502 and 503 errors explained for website owners

Learn what HTTP 500, 502 and 503 errors usually indicate, which layer to investigate, what evidence to collect, and when restarting a service is not the real fix.

Read the guide

cPanel error logs: where to look when a site breaks

cPanel exposes recent website errors, while server and application logs may contain deeper detail. Learn which log to check for PHP, Apache, cPanel, mail, and system failures.

Read the guide

Domain not resolving: how to find the broken DNS layer

When a domain is not resolving, check registration status, delegation, authoritative nameservers, zone records, DNSSEC, and recursive results in that order.

Read the guide

More troubleshooting guides

We will handle the move. You check it first.

Your current site stays online until your new one is ready. You approve the copy first, and if anything is not right we switch you back right away. The price you pick is the price you renew at.

Start my free moveSee plans and prices
See pricesFree move