Обсуждение: How Using new created DB

Поиск
Список
Период
Сортировка

How Using new created DB

От
LJJGIS
Дата:
Connect to postgres with

c:\>psql.exe  -h localhost -p 5432 postgres "postgres"

And then
   postgres=# create database mydb

Then I try to connect to "mydb" with

  C:\> psql mydb
After try many password, include postgres password and OS user password
report ** psql: FATAL:  password authentication failed for user
"Administrator" **
OR
  C:\>psql -h localhost -p 5432 mydb "mydb"
After try many password, include postgres password and OS user password
report ** psql: FATAL:  password authentication failed for user "mydb"  **

Could someone here help to illustrate how to connect to a newly created
database




--
View this message in context: http://www.nabble.com/How-Using-new-created-DB-t1334225.html#a3564598
Sent from the PostgreSQL - general forum at Nabble.com.


Re: How Using new created DB

От
Scott Marlowe
Дата:
On Thu, 2006-03-23 at 20:18, LJJGIS wrote:
> Connect to postgres with
>
> c:\>psql.exe  -h localhost -p 5432 postgres "postgres"
>
> And then
>    postgres=# create database mydb
>
> Then I try to connect to "mydb" with
>
>   C:\> psql mydb
> After try many password, include postgres password and OS user password
> report ** psql: FATAL:  password authentication failed for user
> "Administrator" **
> OR
>   C:\>psql -h localhost -p 5432 mydb "mydb"
> After try many password, include postgres password and OS user password
> report ** psql: FATAL:  password authentication failed for user "mydb"  **
>
> Could someone here help to illustrate how to connect to a newly created
> database

Is this on the same machines(s)?  I.e. are you running psql on the same
machine (client) against he same machine (server) for both examples?

Also, note that in the first example, you're connecting via tcp/ip with
-h localhost -p 5432, but in the second example you're not specifying
those things.  Have you tried changing ONLY the database name and
specifying the username postgres?

PostgreSQL has an internal set of names it uses.  They don't come from
the OS.  You need to use the "create user" and "alter user" commands to
create and change those.

It's all in the docs at:
http://www.postgresql.org/docs/8.1/static/sql-createuser.html