How to Fix “Unable to Connect to the Database” in Joomla

“Unable to connect to the database” means Joomla could not open the database connection required to start normally. Work from the database service outward: availability, credentials, endpoint, account permissions, network requirements, and finally the PHP database driver.

Capture the failure before editing settings

Record the exact message and timestamp from Joomla, PHP, and hosting logs. Preserve a copy of configuration.php. If the failure began after a migration, password change, PHP change, or hosting move, note that event because it sharply narrows the likely cause.

Confirm the database server is reachable

  1. Check the host's service-status or database-management screen.
  2. Open phpMyAdmin or the provider's database console.
  3. Confirm the intended database still exists and the account is active.
  4. For a remote database, confirm the hostname and network path have not changed.

If the database service itself is unavailable, restore that service before modifying Joomla.

Verify the values Joomla is using

Compare $host, $user, $password, $db, and $dbtype in configuration.php with the current hosting values. A hosting migration or password rotation can make an otherwise valid Joomla installation unable to connect.

Keep credentials private and avoid broadening database privileges beyond what Joomla needs merely to suppress the error.

Test the credentials independently

  1. Connect with the same account through the host's supported database tool.
  2. If login fails, repair the database account or password first.
  3. If login succeeds, verify access to the Joomla database and tables.
  4. For remote databases, verify that connections from the Joomla web server are allowed.

A successful independent login proves the credentials are valid, but not necessarily that Joomla's PHP process can reach the same endpoint.

Check PHP and encrypted-connection requirements

Confirm the PHP version serving the site has the appropriate database extension for the configured Joomla driver. If the database requires TLS, certificates, a non-default port, or a private endpoint, use the hosting provider's documented connection settings. Consult the current Joomla technical requirements for supported database platforms and PHP modules.

Retest Joomla and watch for recurring failures

  1. Load the frontend.
  2. Sign in to Administrator.
  3. Save a noncritical item to prove write access.
  4. Recheck logs after several requests.

If the site reconnects but later drops again, investigate database connection limits, server restarts, resource pressure, or network instability instead of repeatedly changing credentials.


Need More Help with Joomla?

Still having trouble? Open a support ticket with QuantaCade Support and we'll be happy to help where we can.

Support priority is given to QuantaCade products, services, and customers. However, we're also happy to assist fellow Joomla users with general Joomla questions and troubleshooting when possible.

QuantaCade is an independent Joomla extension developer and is not official Joomla support. Some issues involving third-party extensions, hosting environments, server configurations, or other systems outside our development control may be beyond what we're able to resolve.

Open a Support Ticket