Thread: what do I wrong???

what do I wrong???

From
Borsos József
Date:
$conn_string = "host=x.x.x.x port=5432 dbname=xxxx user=COMPAX password=xxxx";
  $connect = pg_connect($conn_string);
 
RESULT:
 
Warning: pg_connect() [function.pg-connect]: Unable to connect to PostgreSQL server: Password authentication failed for user 'COMPAX' . in xxx on line 4

Re: what do I wrong???

From
Matthew Horoschun
Date:
Hi Borsos,

Could be a lot of different things.

1. What does pg_hba.conf contain?

2. You appear to be connecting using TCP/IP. Have you started
postmaster with the -i option or is 'tcpip_tocket = true' in
postgresql.conf?

3. Can you connect using the same host, port, dbname, user and password
using the psql command-line client?

Matthew.

On Saturday, January 25, 2003, at 04:57  AM, Borsos József wrote:

> $conn_string = "host=x.x.x.x port=5432 dbname=xxxx user=COMPAX
> password=xxxx";
>   $connect = pg_connect($conn_string);
>  
> RESULT:
>  
> Warning: pg_connect() [function.pg-connect]: Unable to connect to
> PostgreSQL server: Password authentication failed for user 'COMPAX' .
> in xxx on line 4
>

--
Matthew Horoschun
Network Administrator
CanPrint Communications Pty. Ltd.


how to start with postgreSQL?

From
"_root.paulSutcliffe"
Date:

how can I do to create users, create a data base and make it work in postgreSQL? I can do it on mySQL but not in postgreSQL , they are not supossed to be the same? I have php 4 in mandrake 9 , and i'm doing local tests on my pc , but i don't have lan, i will apreciate the help of anyone who helps me.


_root.paulSutcliffe;

 



Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now

Re: how to start with postgreSQL?

From
"scott.marlowe"
Date:
On Tue, 28 Jan 2003, _root.paulSutcliffe wrote:

>
> how can I do to create users, create a data base and make it work in
> postgreSQL? I can do it on mySQL but not in postgreSQL , they are not
> supossed to be the same? I have php 4 in mandrake 9 , and i'm doing
> local tests on my pc , but i don't have lan,  i will apreciate the help
> of anyone who helps me.

No, they're not the same, and sadly for your future database experiences,
this is one area in which most databases are not the same.

you'll need to take a quick tour of the administrators guide:

http://www.postgresql.org/docs/view.php?version=7.3&file=admin.html

the quick skinny is that you can use the command line tools as the
postgres super user (su - to root, then su - to postgres) to create
databases and users to start.

createuser
createdb

should work.

but you really need to read the administrators guide a bit to get a feel
for the things you'll likely need to know.

We'll teach ya to fish, we won't fish for ya...


Re: how to start with postgreSQL?

From
"Christopher Kings-Lynne"
Date:
No, they are not supposed to be the same.  Use the 'createdb' and 'createuser' command-line programs to set it up. Or even read the manual...
 
Chris
-----Original Message-----
From: pgsql-php-owner@postgresql.org [mailto:pgsql-php-owner@postgresql.org]On Behalf Of _root.paulSutcliffe
Sent: Wednesday, 29 January 2003 7:40 AM
To: pgsql-php@postgresql.org
Subject: [PHP] how to start with postgreSQL?

how can I do to create users, create a data base and make it work in postgreSQL? I can do it on mySQL but not in postgreSQL , they are not supossed to be the same? I have php 4 in mandrake 9 , and i'm doing local tests on my pc , but i don't have lan, i will apreciate the help of anyone who helps me.


_root.paulSutcliffe;

 



Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now

Re: how to start with postgreSQL?

From
"Randy Johnson"
Date:
My email is now catch all and do not know which one i used to subscribe to
this list.  How do I ger unsubscribed?

Randy


Re: what do I wrong???

From
Matthew Horoschun
Date:
> Thank You for answer.
>
> 1. and 2. I don't no, becouse I'm not administrator on server.
> PostgreSQL
> server 7.1 and RedHut Linux x.xx
> 3. Yes when I connet to the server with SSH client PuTTY for windows.
>
> My Web server run on Win2000, and PHP code is on IIS 5.0 server. I
> mean it
> is a problem with crypt() routine.


It would be a good idea to contact your system administrator and ask
them 1 and 2, otherwise you'll be wasting your time with trial and
error.

Alternatively, if you have SSH access to the machine then you could try
working both out for yourself (do a process listing, see if you have
read access to postgresql.conf and pg_hba.conf)

How do you know its a problem with the crypt() routine? I can't see how
that could be related, unless I'm missing something significant.

Matthew.


--
Matthew Horoschun
Network Administrator
CanPrint Communications Pty. Ltd.

Mobile:        0417 282 378
Direct:        (02) 6295 4544
Telephone:    (02) 6295 4422
Facsimile:     (02) 6295 4473


Re: what do I wrong???

From
Borsos József
Date:
 
----- Original Message -----
Sent: Tuesday, January 28, 2003 3:04 PM
Subject: Re: [PHP] what do I wrong???

Hi Jozsef,

Ther is my code  (db_connect.php):

<?php
//*********************************************************************************
//       db_connect.php
//
//      1. Connect to the server
//    2. Connect to the database with the username=postgres and pw=postgre$
//
//*********************************************************************************

$server="172.30.30.27";
$port="5432";
$db="doors";
$dbusername="postgres";
$dbuserpw="postgre$";

//connect to server
$serverconn =pg_Connect($server, $port,$db);

    if(!$serverconn)
        {
        echo "ERROR: Connection to Server failed!";
        exit;
        }
       
$dbconn =pg_pconnect("dbname=$db user=$dbusername password=$dbuserpw");
       
        if(!$dbconn)
        {
        echo "ERROR: Connection to Database failed!";
        exit;
        }
?>       


Borsos József wrote:
$conn_string = "host=x.x.x.x port=5432 dbname=xxxx user=COMPAX password=xxxx";
  $connect = pg_connect($conn_string);
 
RESULT:
 
Warning: pg_connect() [function.pg-connect]: Unable to connect to PostgreSQL server: Password authentication failed for user 'COMPAX' . in xxx on line 4

 
Thanks for helping, but this is the answer:
 
Warning: pg_connect() [function.pg-connect]: Unable to connect to PostgreSQL server: fe_sendauth: no password supplied . in C:\Inetpub\wwwroot\Borsos\db_connect.php on line 17
ERROR: Connection to Server failed!