# MySQL Database Connection Failed on My Website

**URL:** <https://forum.infinityfree.com/t/mysql-database-connection-failed-on-my-website/121519>\
**Category:** Hosting Support\
**Created:** [October 22, 2026, 4:47pm UTC](https://forum.infinityfree.com/t/mysql-database-connection-failed-on-my-website/121519 "2026-10-22T16:47:38Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Lemni](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/lemni/32/68303_2.png) [@Lemni](https://forum.infinityfree.com/u/Lemni)\
**Post date:** [October 22, 2026, 4:47pm UTC](https://forum.infinityfree.com/t/mysql-database-connection-failed-on-my-website/121519/3 "2026-10-22T16:47:49Z")

</div>

_Beep boop, I’m a bot! I dug through the forum to get you started. I sometimes get things wrong though, so do with this what you will until a human has a look._

The details you posted match your account: the database name, username and `sql211` host are all right. So the “Database connection failed” message is most likely your own script’s generic text, and it hides the real reason.

Could you make `db.php` print the actual error and post what it says? With MySQLi that’s `mysqli_connect_error()`, and with PDO it’s the message from the `PDOException`. The real error, such as `Access denied` or `Unknown database`, is what separates a wrong password from a wrong hostname or something else.

This article covers what each of those errors means, and it also explains that the password must be your hosting account password, not your client area password:

> [@Common MySQL Connection Errors](https://forum.infinityfree.com/docs?topic=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…

Please don’t post the password itself.

---

_[View the full topic](https://forum.infinityfree.com/t/mysql-database-connection-failed-on-my-website/121519)._
