# Unable to connect to database

**URL:** <https://forum.infinityfree.com/t/unable-to-connect-to-database/94046>\
**Category:** Hosting Support\
**Created:** [May 25, 2024, 10:42pm UTC](https://forum.infinityfree.com/t/unable-to-connect-to-database/94046 "2024-05-25T22:42:31Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon45866002](https://forum.infinityfree.com/letter_avatar/anon45866002/32/6_449c533f586939b6e5f246632a46421f.png) [@anon45866002](https://forum.infinityfree.com/u/anon45866002)\
**Post date:** [May 25, 2024, 10:42pm UTC](https://forum.infinityfree.com/t/unable-to-connect-to-database/94046/1 "2024-05-25T22:42:31Z")

</div>

### Website URL [motueka-bnb.infinityfreeapp.com](http://motueka-bnb.infinityfreeapp.com)

### Error Message

**Fatal error** : Uncaught mysqli\_sql\_exception: Access denied for user ‘if0\_36604612’@‘192.168.0.51’ (using password: YES) in /home/vol13\_3/infinityfree.com/if0\_36604612/htdocs/test\_connection.php:12 Stack trace: #0 /home/vol13\_3/infinityfree.com/if0\_36604612/htdocs/test\_connection.php(12): mysqli-\>\_\_construct(‘sql108.infinity…’, ‘if0\_36604612’, Object(SensitiveParameterValue), ‘if0\_36604612\_mo…’) #1 {main} thrown in **/home/vol13\_3/infinityfree.com/if0\_36604612/htdocs/test\_connection.php** on line **12**

all my credentials are correct I have double / triple checked but continue to get this error

(other information and details relevant to your question)

---

<div class="post-metadata">

**Author:** ![Greenreader9](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/greenreader9/32/22847_2.png) [@Greenreader9](https://forum.infinityfree.com/u/Greenreader9)\
**Post date:** [May 25, 2024, 10:46pm UTC](https://forum.infinityfree.com/t/unable-to-connect-to-database/94046/2 "2024-05-25T22:46:23Z")

</div>

> [@anon45866002](#):
>
> all my credentials are correct

Nope, the database name or password is wrong.

the database name is `if0_36604612_<DATABASENAME>`

the password can be found in your client area (It is not the password you use to login to the dashboard)

see more:

> [@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…

---

<div class="post-metadata">

**Author:** ![anon45866002](https://forum.infinityfree.com/letter_avatar/anon45866002/32/6_449c533f586939b6e5f246632a46421f.png) [@anon45866002](https://forum.infinityfree.com/u/anon45866002)\
**Post date:** [May 25, 2024, 10:52pm UTC](https://forum.infinityfree.com/t/unable-to-connect-to-database/94046/3 "2024-05-25T22:52:30Z")

</div>

I am aware of that and am using the correct password and database name , hence the reason I’m posting here

---

<div class="post-metadata">

**Author:** ![anon45866002](https://forum.infinityfree.com/letter_avatar/anon45866002/32/6_449c533f586939b6e5f246632a46421f.png) [@anon45866002](https://forum.infinityfree.com/u/anon45866002)\
**Post date:** [May 25, 2024, 10:54pm UTC](https://forum.infinityfree.com/t/unable-to-connect-to-database/94046/4 "2024-05-25T22:54:19Z")

</div>

### Account Details

USERNAME

if0\_36604612

PASSWORD

` ************* ` Show/Hide

STATUS

Active

LABEL

Website for [motueka-bnb.infinityfreeapp.com](http://motueka-bnb.infinityfreeapp.com)

WEBSITE IP

185.27.134.94

HOSTING VOLUME

vol13\_3

HOME DIRECTORY

/home/vol13\_3/infinityfree.com/if0\_36604612

CREATION DATE

2024-05-24

---

<div class="post-metadata">

**Author:** ![anon45866002](https://forum.infinityfree.com/letter_avatar/anon45866002/32/6_449c533f586939b6e5f246632a46421f.png) [@anon45866002](https://forum.infinityfree.com/u/anon45866002)\
**Post date:** [May 25, 2024, 10:55pm UTC](https://forum.infinityfree.com/t/unable-to-connect-to-database/94046/5 "2024-05-25T22:55:56Z")

</div>

I can login to myphpadmin so password is correct and so is the database name

---

<div class="post-metadata">

**Author:** ![anon45866002](https://forum.infinityfree.com/letter_avatar/anon45866002/32/6_449c533f586939b6e5f246632a46421f.png) [@anon45866002](https://forum.infinityfree.com/u/anon45866002)\
**Post date:** [May 25, 2024, 11:09pm UTC](https://forum.infinityfree.com/t/unable-to-connect-to-database/94046/6 "2024-05-25T23:09:01Z")

</div>

So whats the next step because its all correct?

---

<div class="post-metadata">

**Author:** ![anon45866002](https://forum.infinityfree.com/letter_avatar/anon45866002/32/6_449c533f586939b6e5f246632a46421f.png) [@anon45866002](https://forum.infinityfree.com/u/anon45866002)\
**Post date:** [May 25, 2024, 11:12pm UTC](https://forum.infinityfree.com/t/unable-to-connect-to-database/94046/7 "2024-05-25T23:12:13Z")

</div>

```auto
<?php

ini_set('display_errors', 1);

ini_set('display_startup_errors', 1);

error_reporting(E_ALL);

// Database connection test script

$host = "sql108.infinityfree.com";

$user = "if0_36604612"; 

$pass = "MGDK1K9q0xxxx"; 

$db = "if0_36604612_motueka_bnb";

$conn = new mysqli($host, $user, $pass, $db);

if ($conn->connect_error) {

die("Connection failed: " . $conn->connect_error);

}

echo "Connected successfully";

?>

```

---

<div class="post-metadata">

**Author:** ![anon45866002](https://forum.infinityfree.com/letter_avatar/anon45866002/32/6_449c533f586939b6e5f246632a46421f.png) [@anon45866002](https://forum.infinityfree.com/u/anon45866002)\
**Post date:** [May 26, 2024, 12:04am UTC](https://forum.infinityfree.com/t/unable-to-connect-to-database/94046/8 "2024-05-26T00:04:59Z")

</div>

Hello? so we get a generic answer and that’s it? no more reply’s no help ?  
all the credentials are correct so i need more help please

---

<div class="post-metadata">

**Author:** ![Greenreader9](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/greenreader9/32/22847_2.png) [@Greenreader9](https://forum.infinityfree.com/u/Greenreader9)\
**Post date:** [May 26, 2024, 12:11am UTC](https://forum.infinityfree.com/t/unable-to-connect-to-database/94046/9 "2024-05-26T00:11:46Z")

</div>

Please remember that everyone here is volunteering their time to help you out. Have patience, someone will assist you when they can.

I am out of things that I can check without access to your account, which is something that I don’t have. If I missed something and someone else catches it, they’ll reply. Otherwise, Admin will most likely help you whenever he comes online.

---

<div class="post-metadata">

**Author:** ![anon45866002](https://forum.infinityfree.com/letter_avatar/anon45866002/32/6_449c533f586939b6e5f246632a46421f.png) [@anon45866002](https://forum.infinityfree.com/u/anon45866002)\
**Post date:** [May 26, 2024, 12:29am UTC](https://forum.infinityfree.com/t/unable-to-connect-to-database/94046/10 "2024-05-26T00:29:47Z")

</div>

Thank you, and sorry don’t mean to come across rude, my bad. I believe I have it sorted now

---

<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:** [May 26, 2024, 8:59am UTC](https://forum.infinityfree.com/t/unable-to-connect-to-database/94046/11 "2024-05-26T08:59:35Z")

</div>

> [@anon45866002](#):
>
> I believe I have it sorted now

So, just to confirm, you were able to resolve the issue? You don’t need any further help with this?

---

<div class="post-metadata">

**Author:** ![system](https://infinityfree-forum-uploads.s3.dualstack.eu-central-1.amazonaws.com/original/3X/b/0/b024fd3fa88bae093c9576e55c2c94e33f890206.svg) [@system](https://forum.infinityfree.com/u/system)\
**Post date:** [June 2, 2024, 9:00am UTC](https://forum.infinityfree.com/t/unable-to-connect-to-database/94046/12 "2024-06-02T09:00:07Z")

</div>

Closed on June 2, 2024, 9:00am UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
