Host does not exist when calling it using php

Connection failed: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for sql309.infinityfree.com failed: No such host is known.

4 Likes

The problem is the mysql hostname i tried pinging it but it is not live . So im not sure if the problem is related to DNS or not

Great, this means that our MySQL servers are working as expected, as they’re never reachable on the Internet.

3 Likes

Take note

4 Likes

Where are you trying to run the code that generates this message? If you try to do it from your own computer, that will not work, because the database servers are only accessible from within our network.

If you run this code on our hosting and still get this error, then please make sure that there are no additional whitespace characters (spaces, tabs, newlines) in the database hostname, because those will actually make it a different value that doesn’t work.

If you already checked both of these things, can you please share exactly where and how you’re setting up this database connection? An account username, URL to reproduce the issue, and location of the code from where you create the connection would help a lot.

3 Likes

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