- 论坛徽章:
- 0
|
原帖由 shaver 于 2006-9-11 14:55 发表
这个问题终于解决了,和大家分享一下,方法是在使用psql之前,给两个环境变量赋值。
set PGUSER=
set PGPASSWORD=
psql .....
希望大家不要笑话
那你是你没有看帮助
Connection options:
-h HOSTNAME database server host or socket directory (default: "local socket")
-p PORT database server port (default: "5432")
-U NAME database user name (default: "postgres")
-W prompt for password (should happen automatically)
测试:
[postgres@localhost ~]$ /usr/local/pgsql/bin/psql
psql: FATAL: no pg_hba.conf entry for host "[local]", user "postgres", database "postgres"
[postgres@localhost ~]$ /usr/local/pgsql/bin/psql -hlocalhost -U postgres
Welcome to psql 8.2.6, 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
\q to quit
postgres=#
postgres=# \l
List of databases
Name | Owner | Encoding
-----------+----------+----------
postgres | postgres | UTF8
t_girl | postgres | UTF8
template0 | postgres | UTF8
template1 | postgres | UTF8
(4 rows)
postgres=#
|
|
|