Dear Stuart. Thank you very much for help. Yes, you're very correct. once again thanks. I can administrate my postgresql with psql now, but not with KNoda (over TCP/IP connection). I can not login from KNoda. The values of parameter those I used are: " host = localhost database name = rumahsakit user = patrix password = postgres TCP Port = 5432 ". The error message is : " Server message: FATAL: Ident authentication failed for user "patrix" " What is my mistake? please tell me. I set my password for postgres like this: " rumahsakit=# alter user patrix encrypted password 'postgres'; ALTER ROLE ". =====the postgresql.conf of "rumahsakit" postgres@acer-suse:~/data/base/rumahsakit> pwd /var/lib/pgsql/data/base/rumahsakit postgres@acer-suse:~/data/base/rumahsakit> cat postgresql.conf ...<<SNIP>>... #--------------------------------------------------------------------------- # FILE LOCATIONS #--------------------------------------------------------------------------- # The default values of these variables are driven from the -D command line # switch or PGDATA environment variable, represented here as ConfigDir. #data_directory = 'ConfigDir' # use data in another directory #hba_file = 'ConfigDir/pg_hba.conf' # host-based authentication file #ident_file = 'ConfigDir/pg_ident.conf' # IDENT configuration file # If external_pid_file is not explicitly set, no extra pid file is written. #external_pid_file = '(none)' # write an extra pid file #--------------------------------------------------------------------------- # CONNECTIONS AND AUTHENTICATION #--------------------------------------------------------------------------- # - Connection Settings - listen_addresses = '*' # what IP address(es) to listen on; # comma-separated list of addresses; # defaults to 'localhost', '*' = all port = 5432 max_connections = 150 # note: increasing max_connections costs ~400 bytes of shared memory per # connection slot, plus lock space (see max_locks_per_transaction). You # might also need to raise shared_buffers to support more connections. superuser_reserved_connections = 2 #unix_socket_directory = '' #unix_socket_group = '' unix_socket_permissions = 0777 # octal #bonjour_name = '' # defaults to the computer name # - Security & Authentication - #authentication_timeout = 60 # 1-600, in seconds #ssl = off password_encryption = on #db_user_namespace = off # Kerberos #krb_server_keyfile = '' #krb_srvname = 'postgres' #krb_server_hostname = '' # empty string matches any keytab entry #krb_caseins_users = off # - TCP Keepalives - # see 'man 7 tcp' for details #tcp_keepalives_idle = 0 # TCP_KEEPIDLE, in seconds; # 0 selects the system default #tcp_keepalives_interval = 0 # TCP_KEEPINTVL, in seconds; # 0 selects the system default #tcp_keepalives_count = 0 # TCP_KEEPCNT; # 0 selects the system default ...<<SNIP>>... =====my pg_hba.conf postgres@acer-suse:~/data/base/rumahsakit> cat ./pg_hba.conf ...<<SNIP>>... # TYPE DATABASE USER CIDR-ADDRESS METHOD # "local" is for Unix domain socket connections only local all all password # IPv4 local connections: host all all 127.0.0.1/32 password host all all 0.0.0.0/0.0.0.0 password # IPv6 local connections: host all all ::1/128 md5 postgres@acer-suse:~/data/base/rumahsakit> On Sat, 2006-01-21 at 11:14 -0500, Stuart wrote:
Patrix
I think what Glenn was getting you to do was this:
su - <<enter root password at prompt>> su - postgres <<you will not get prompted for a password>>
This necessary because postgres has an unknown password (but root can become any user).
Once you are logged on your box as postgres issue the command:
psql template1
This should log you into the postgresql database template1 (which comes with postgres) and now you can use the following command.
create user username password 'password'
Add "createdb" and "createuser" to the above line for superuser privileges.
Exit postgresql with "\q"
\q [to exit psql]
Now you can log back in as yourself and create your database: exit [no longer postgres] exit [no longer root] psql template1 template1=# create database mydatabase; you should see the response "CREATE DATABASE"
Make sure to switch to your database with "\c mydatabase" before adding tables, etc., because any changes to template1 are propagated to all newly created databases.
Stuart