# Erreur : SQLSTATE\[HY000\] \[2002\] php\_network\_getaddresses: getaddrinfo failed: No address associated with hostname

**URL:** <https://forum.infinityfree.com/t/erreur-sqlstate-hy000-2002-php-network-getaddresses-getaddrinfo-failed-no-address-associated-with-hostname/52590>\
**Category:** Hosting Support\
**Created:** [October 3, 2021, 1:33pm UTC](https://forum.infinityfree.com/t/erreur-sqlstate-hy000-2002-php-network-getaddresses-getaddrinfo-failed-no-address-associated-with-hostname/52590 "2021-10-03T13:33:01Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon9947149](https://forum.infinityfree.com/letter_avatar/anon9947149/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon9947149](https://forum.infinityfree.com/u/anon9947149)\
**Post date:** [October 3, 2021, 1:33pm UTC](https://forum.infinityfree.com/t/erreur-sqlstate-hy000-2002-php-network-getaddresses-getaddrinfo-failed-no-address-associated-with-hostname/52590/1 "2021-10-03T13:33:01Z")

</div>

Bonjour, je vous contacte car je reçois une erreur quand j’essaie de me connecter a la base de données de mon site.

ERROR:

**Erreur : SQLSTATE[HY000] [2002] php\_network\_getaddresses: getaddrinfo failed: No address associated with hostname**

Je vous prie de m’aider. Cordialement.

---

<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:** [October 3, 2021, 2:48pm UTC](https://forum.infinityfree.com/t/erreur-sqlstate-hy000-2002-php-network-getaddresses-getaddrinfo-failed-no-address-associated-with-hostname/52590/2 "2021-10-03T14:48:09Z")

</div>

> [@anon9947149](#):
>
> Hello, I am contacting you because I receive an error when I try to connect to my site’s database.
> 
> ERROR:
> 
> Error: SQLSTATE[HY000] [2002] php\_network\_getaddresses: getaddrinfo failed: No address associated with hostname
> 
> Please help me. Thank you. Regards.

Hello and welcome. Please type in English on this forum.

Can you please give some additional detail, such as the name of the program used, and how you are trying to connect?  
Thanks

---

<div class="post-metadata">

**Author:** ![anon9947149](https://forum.infinityfree.com/letter_avatar/anon9947149/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon9947149](https://forum.infinityfree.com/u/anon9947149)\
**Post date:** [October 3, 2021, 3:03pm UTC](https://forum.infinityfree.com/t/erreur-sqlstate-hy000-2002-php-network-getaddresses-getaddrinfo-failed-no-address-associated-with-hostname/52590/3 "2021-10-03T15:03:28Z")

</div>

I created a member area, with registration and login form. When I use the registration page an error puts me “No address associated with hostname”

---

<div class="post-metadata">

**Author:** ![anon9947149](https://forum.infinityfree.com/letter_avatar/anon9947149/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon9947149](https://forum.infinityfree.com/u/anon9947149)\
**Post date:** [October 3, 2021, 3:04pm UTC](https://forum.infinityfree.com/t/erreur-sqlstate-hy000-2002-php-network-getaddresses-getaddrinfo-failed-no-address-associated-with-hostname/52590/4 "2021-10-03T15:04:58Z")

</div>

There is a connection problem with the database

---

<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:** [October 3, 2021, 4:53pm UTC](https://forum.infinityfree.com/t/erreur-sqlstate-hy000-2002-php-network-getaddresses-getaddrinfo-failed-no-address-associated-with-hostname/52590/5 "2021-10-03T16:53:58Z")

</div>

URL?  
How are you connecting?  
What code are you using?

> [@anon9947149](#):
>
> connection problem with the database

That could possible be the problem, but I can’t say until, you give enough info. Have you read the pinned topics?

---

<div class="post-metadata">

**Author:** ![anon9947149](https://forum.infinityfree.com/letter_avatar/anon9947149/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon9947149](https://forum.infinityfree.com/u/anon9947149)\
**Post date:** [October 3, 2021, 5:06pm UTC](https://forum.infinityfree.com/t/erreur-sqlstate-hy000-2002-php-network-getaddresses-getaddrinfo-failed-no-address-associated-with-hostname/52590/6 "2021-10-03T17:06:28Z")

</div>

When I try to connect to my database it doesn’t work.

---

<div class="post-metadata">

**Author:** ![anon9947149](https://forum.infinityfree.com/letter_avatar/anon9947149/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon9947149](https://forum.infinityfree.com/u/anon9947149)\
**Post date:** [October 3, 2021, 5:08pm UTC](https://forum.infinityfree.com/t/erreur-sqlstate-hy000-2002-php-network-getaddresses-getaddrinfo-failed-no-address-associated-with-hostname/52590/7 "2021-10-03T17:08:25Z")

</div>

\<?php try { $bdd = new PDO('mysql:host=sql205.epizy.com;dbname=epiz\_\*\*\*\*\*\*\*\*\*\_users;charset=utf8', 'epiz\_\*\*\*\*\*\*\*\*\*', '\*\*\*\*\*\*\*\*\*\*\*\*'); } catch(PDOException $e) { die('Erreur : '.$e-\>getMessage()); }

---

<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:** [October 10, 2021, 5:09pm UTC](https://forum.infinityfree.com/t/erreur-sqlstate-hy000-2002-php-network-getaddresses-getaddrinfo-failed-no-address-associated-with-hostname/52590/8 "2021-10-10T17:09:12Z")

</div>

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