php-windows Digest 26 Jul 2004 08:26:03 -0000 Issue 2332

Topics (messages 24260 through 24261):

PHP to mySQL connect...
        24260 by: \[php\]Walter

Re: [pgsql] connectivity problems
        24261 by: Luis Moreira

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
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    = "";
   $db_name    = "myDB";
   $db_host    = 'db.torres.ws';  // '192.168.1.10'

   mysql_pconnect($db_host, $db_user, $db_pass)
      or die("Unable to connect to SQL server");

   mysql_select_db($db_name)
      or die("Unable to select database");

I get this...

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

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

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?

Thanks

Walter

--- End Message ---
--- Begin Message ---
Hi

I suppose yopu didn't "google" for the error message...
Try to read this http://www.postgresql.org/docs/7.3/static/client-authentication.html


Luis

Ciprian Constantinescu wrote:

I have the following code

[CODE]
<?php
$dbconn3 = pg_connect("host=somehost port=5432 dbname=adatabase
user=postgres");
?>
[/CODE]

And when i run the script I get " Warning: pg_connect()
[function.pg-connect]: Unable to connect to PostgreSQL server: FATAL:
missing or erroneous pg_hba.conf file"

I have searched for pg_hba.conf, but I don't have it. Where should it be and
what should it contain?




--- End Message ---

Reply via email to