0

I keep getting the error below once in a while and then it goes away everything works fine. I was wondering how can I correct this problem? And can someone tell me what in hell is causing this problem?

Error.

mysqli_connect() [function.mysqli-connect]: (HY000/2005): Unknown MySQL server host

The error above points to the code below.

$mysqli = mysqli_connect("i.db.8473545.hostedresource.com", "i", "password", "i");
7
  • then add @ in front of function @mysqli_connect() Commented Dec 2, 2010 at 13:36
  • and what will that accomplish? Commented Dec 2, 2010 at 13:37
  • It suppresses the error message but won't fix the problem Commented Dec 2, 2010 at 13:44
  • @goreSplatter thanks, how can I fix the problem though? Commented Dec 2, 2010 at 13:46
  • 1
    Could you post some code that directly relates to this error? Commented Dec 2, 2010 at 13:46

1 Answer 1

1

You're probably on a shared hosting environment with an external MySQL server. The error message hints on DNS problems resolving "i.db.8473545.hostedresource.com".

As a temporary fix, find out the IP "i.db.8473545.hostedresource.com" points to and use the IP adress as host name for mysql_connect(). See if you still get the error afterwards.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.