# Error establishing a database connection

**URL:** <https://forum.infinityfree.com/t/error-establishing-a-database-connection/97875>\
**Category:** Hosting Support\
**Created:** [August 22, 2024, 10:38am UTC](https://forum.infinityfree.com/t/error-establishing-a-database-connection/97875 "2024-08-22T10:38:22Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Admin](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/admin/32/36437_2.png) [@Admin](https://forum.infinityfree.com/u/Admin)\
**Post date:** [August 22, 2024, 1:14pm UTC](https://forum.infinityfree.com/t/error-establishing-a-database-connection/97875/2 "2024-08-22T13:14:57Z")

</div>

A good place to start is to enable debug mode in WordPress. That way, you can get the actual database error message, rather than “it’s not working but we won’t tell you why”.

> **[Debugging in WordPress – Advanced Administration Handbook |...](https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/)**
>
> Debugging PHP code is part of any project, but WordPress comes with specific debugging systems designed to simplify the process as well as…

Once you have the error, you can check it against this article to find a possible cause:

> [@Common MySQL Connection Errors](https://forum.infinityfree.com/t/common-mysql-connection-errors/49338):
>
> Many websites use MySQL databases to store information and settings. However, there are some reasons why the connection to the database may fail. This article describes some commonly seen error messages when connecting to a database, as well as some general tips to keep in mind when setting up a database connection. Common Error Messages Using MySQL is great, but the error message returned if there is an issue logging in to your database can be quite confusing. Here are some commonly seen error…

If you still need help, please share the full error message you found with the debug mode.

---

_[View the full topic](https://forum.infinityfree.com/t/error-establishing-a-database-connection/97875)._
