Re: Cannot connect PostgreSQL 7.3.1. Using PHP thru...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-----BEGIN PGP SIGNED MESSAGE-----

I think  the problem is the username. you have a user "administrator"? At 
postresql the administratzor is the user postgres.

Perhaps you try first with 'reateuser' to create a new user, peraps with all 
rights, and then you can try to connect with  this username an password.

Hope this can help

H.Etzel



Patrick Lok wrote:

> tcpip_socket is enabled!
> access to postgresql is granted; ip-address is added to pg_hba.conf -
> METHOD = trust
> 
> ./pl
> 
> 
> 
> "Patrick Lok" <patricklok@msn.com> wrote in message
> 20030307100923.84342.qmail@pb1.pair.com">news:20030307100923.84342.qmail@pb1.pair.com...
>> I have the following setups:
>> *PostgreSql 7.3.1 and MSSQL on Win2k server (A)
>> *Apache 1.3.x + PHP 4.3.1.1(using CGI & loaded w/ php_pgsql.dll) +  ODBC
> for
>> PostgreSql v7.02.00.05 on Win2K server (B)
>>
>> I tried to use phppgadmin 2.4.2  and odbc for postgresql to connect
>> PostgreSql in (A) but both connection failed!
>>
>> Can somebody give me some advices?
>> Can PHP access remote DB server?
>> Can ODBC for PostgreSql access remote DB server?
>>
>> Best regards
>> ./pl
>>
>>
>>
>> Using  PHPPGADMIN 2.4.2 to administer but it says "Wrong
> username/password.
>> Access denied".
>>
>> The following is logged on psqlodbc_xxxx.log:
>> DSN info:
>>
> 
DSN='PostgreSQL',server='192.168.1.16',port='5432',dbase='tet',user='adminis
>> trator',passwd=''
>>
>> onlyread='0',protocol='6.4',showoid='0',fakeoidindex='0',showsystable='0'
>>           conn_settings='',conn_encoding='OTHER'
>>           translation_dll='',translation_option=''
>>
>>
>> I wrote a simple php program in (B) to connect to server (A) using odbc
> for
>> postgresql but the connection failed!
>>
>> <?php
>> $rtn = odbc_connect("PostgreSql","administrator","");
>> $cur=odbc_exec($rtn,"select d_base, high_jrnal from salfmsc");
>> while(odbc_fetch_row($cur)){
>> $fld1=odbc_result($cur,1);
>> $fld2=odbc_result($cur,2);
>> echo $fld1;
>> echo ("-");
>> echo $fld2;
>> echo ("<p>");
>> }
>> echo odbc_close($rtn);
>> ?>
>>
>> BUT Warning is returned.
>> Warning: SQL error: Could not connect to the server; Could not connect to
>> remote socket., SQL state 08001 in SQLConnect in
>> d:\tmp\webcodetest\mstest.php on line 3
>>
>> The following is logged on psqlodbc_xxxx.log:
>> DSN info:
>>
> 
DSN='PostgreSql',server='192.168.1.16',port='5432',dbase='tet',user='adminis
>> trator',passwd=''
>>
>> onlyread='0',protocol='6.4',showoid='0',fakeoidindex='0',showsystable='0'
>>           conn_settings='',conn_encoding='OTHER'
>>           translation_dll='',translation_option=''
>> conn = 15742608, PGAPI_Connect(DSN='PostgreSql', UID='teter', PWD='')
>> Global Options: Version='07.02.0005', fetch=100, socket=4096,
>> unknown_sizes=0, max_varchar_size=254, max_longvarchar_size=8190
>>                 disable_optimizer=1, ksqo=1, unique_index=1,
>> use_declarefetch=0
>>                 text_as_longvarchar=1, unknowns_as_longvarchar=0,
>> bools_as_char=1 NAMEDATALEN=64
>>                 extra_systable_prefixes='dd_;', conn_settings=''
>> conn_encoding='OTHER'
>> CONN ERROR: func=PGAPI_Connect, desc='Error on CC_connect', errnum=101,
>> errmsg='Could not connect to the server'
>>             ------------------------------------------------------------
>>             henv=15742552, conn=15742608, status=0, num_stmts=16
>>             sock=15753592, stmts=15761872, lobj_type=-999
>>             ---------------- Socket Info -------------------------------
>>             socket=-1, reverse=0, errornumber=4, errormsg='Could not
> connect
>> to remote socket.'
>>             buffer_in=15753664, buffer_out=15757768
>>             buffer_filled_in=0, buffer_filled_out=0, buffer_read_in=0
>>
>>

- -- 


- -----BEGIN PGP PUBLIC KEY BLOCK-----
Version: 2.6.3in

mQENAz5p1tsAAAEIAOO1/GiPZI6Tp8n2Cu34Jm+ofXw6gWpXnHcu73WHEIhaUAgV
S+jnpsIWDmBCASIBxFymDKehIcGMrShS2RR0x3lrYBIKtv6/8nzMGLXWSu689FA8
52v5WYge8WCBS0KGEx7CC5jNplPgF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XcBPUoExw1R5f+b15OkD3HEvw==
=xDrV
-----END PGP SIGNATURE-----

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux