[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mysql-win32
Subject:    "Unknown MySQL Server Host" error
From:       "phpWalter" <phpWalter () torres ! ws>
Date:       2004-07-24 7:17:49
Message-ID: 000601c4714e$569bb7d0$0b01a8c0 () TDGDEV1
[Download RAW message or body]

I have 2 machines, a server (Win NT server) and a workstation (Win XP
Pro).

On the server I have PHP, mySQL, Apache, Perl, etc.

If I run this command from the prompt...

   G> mysql -h db.torres.ws -u user

It connects fine.

If I do this from PHP...

   $db_user   = "user";
   $db_pass    = "pass";
   $db_name    = "myDB";
   $db_host    = 'db.torres.ws';  // '192.168.1.10'

   mysql_connect($db_host, $db_user, $db_pass)    // <-- line 12
      or die("Could not connect : " . mysql_error());

   mysql_select_db($db_name)
      or die("Query failed : " . mysql_error());

I get this...

    Warning: mysql_connect(): Unknown MySQL Server Host 'db.torres.ws'
            (11001) in G:\home\php\htdocs\db.php on line 12

But if I use the IP or 'localhost', it connects just fine.

BTW: db.torres.ws is in the HOSTS file on both machines.

This worked before. I had to reinstall the database and now it doesn't
work.

Anyone have any ideas?

I would really like to use the machine name again.

Thanks

Walter



-- 
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe:    http://lists.mysql.com/win32?unsub=mysql-win32@progressive-comp.com

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic