How do I find the hostname that I need to specify for a PHP script to access my mySQL databases?
For most if not all site5 servers the hostname for your mysql settings is “localhost”
it is localhost
You should use “localhost” without the quotes as the MySQL host name.
Set it to localhost
I had tried the obvious answer (“localhost”) before posting to the KB.
Several contributors confirmed that answer is correct (Giovanni, nomore340, Kyle Ross and David). Thank you.
I can, after finding I had a masked error in the live code (since fixed), confirm that this works.
[Aside] I’m not trying to gyp people out of “Star Points” for their answers, it’s just that I cannot approve answers. I have submitted a trouble ticket about this problem.
Correct, you should be using “localhost” as you would be connecting to the database server which is on the same server that your website is hosted on.
You must be Logged In to post an Answer.
Not a member yet? Sign Up Now »