Saturday, March 8, 2008

Changing user password in postgres

1. [root@localhost ~]# psql -d coba -u yourname
psql: warning: extra command-line argument "hastuti" ignored
psql: Warning: The -u option is deprecated. Use -U.
User name: hastuti
Password for user :
Welcome to psql 8.2.3, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query

coba=>

2. use ALTER USER
coba=> alter user yourname with password 'newpasswd';

Is the server running on host 'localhost'; and accepting TCP/IP connections on port 5432?

Tanya:
Sample scripts in PHP file:

The result is..
Unable to connect to PostgreSQL server: could not connect to server: Permission denied
Is the server running on host 'localhost'; and accepting TCP/IP connections on port 5432?

Jawab:
try to update your script into like this..


there is no host=localhost above, maybe its working, i hope..