imbra - How to Fix Database Connection Error on Your Website

A database connection error means your website cannot communicate with its database. This guide helps you fix it.

Steps

  1. In iPanel, navigate to the Databases tab and verify your database exists and is active.

    [screenshot: checking database status]

  2. Click on the database to view the connection details: database name, hostname, username, and password.

    [screenshot: viewing database connection details]

  3. Open your website's configuration file (e.g., wp-config.php for WordPress) in File Manager.

    [screenshot: opening config file]

  4. Compare the database credentials in the config file with those shown in iPanel. Update any mismatches.

    [screenshot: comparing and updating credentials]

  5. Verify the database user has the correct permissions for the database.

    [screenshot: checking database user permissions]

  6. If the database server is on a different host, ensure remote access is enabled.

    [screenshot: checking remote access settings]

Tip: Database connection errors after migration are almost always caused by incorrect credentials in the config file. Double-check the hostname especially.

Related Articles