Just bought 1st server - Unknown MySQL server host error - how to fix?
So, I just bought my first server and am setting things up for the first time. Needless to say, I am a bit lost and would like to seek some advice.
The issue I'm having now is this...
When I try to connect to a mysql DB using the mysql_connect() php function by passing in www.mydomain.com as the host (NOT localhost), I receive the following error:
Unknown MySQL server host 'www.mydomain.com'
My host had originally said it was because DNS info was still propogating. However, it's been several days now and I'm still receiving the same problem.
The reason I use www.mydomain.com at times and not localhost is because I often run scripts from my local machine on the remote DB. I also sometimes query things across domains.
I am currently using WHM/CPanel. Any help would be greatly appreciated! Thanks.
I can successfully ping from my computer. They are all viewable from the browser, as well.
The problem I'm having is only when connecting to the MySQL DB using mysql_connect(). This even happens if the mysql_connect() function is called from the site itself (i.e. mysql_connect('www.mydomain.com' ...) from mydomain.com/connect_to_db.php).