Can[t connect to database


#1

I am having a problem with mysql hostname. I put the hostname in mycode and I get this

error:

Warning: mysql_connect() [function.mysql-connect]: Unknown MySQL server host

‘mysqlworkingmathtool400com’ (1) in /home/roronron/working.mathtool400.com/php1/index.php

on line 3
Unable to select database

I get my host name from here

Hostname (these are all interchangeable) Web Administration Actions
mysql.hotfontsf2.com phpMyAdmin
Delete Hostname
mysql.move.drvoodo.com phpMyAdmin
Delete Hostname
mysql.working.mathtool400.com phpMyAdmin
Delete Hostname

The hostname below I copy and paste into my code
mysql.working.mathtool400.com

This is my line of code where I enter the hostname
mysql_connect(mysql.working.mathtool400.com,$username,$password);


#2

one post is really enough… 3 is just spamming :frowning:

how recently did you create the hostname? perhaps DNS needs time to propagate.

You could also try one of the other hostnames, all 3 point to the same server.

Did you override a variable name in that statement? $username and $password are in variables, was was host originally also? If so put that back and define the variable (it may used elsewhere.)


#3

I’m amazed that PHP accepts that at all without quotes around the hostname. Add some and try again.