2016-02-07 16 views
54

ローカルサーバ上の私自身のpostgresデータベースに接続する際に問題があります。 私はいくつかの同様の問題をGoogleで検索ので、このマニュアル https://help.ubuntu.com/stable/serverguide/postgresql.htmlPostgreSQL:ロールへのログインが許可されていません

を思い付いた:

pg_hba.confは言う:

# TYPE DATABASE  USER   ADDRESS     METHOD 

# "local" is for Unix domain socket connections only 
local all    all          trust 
# IPv4 local connections: 
host all    all    127.0.0.1/32   md5 
# IPv6 local connections: 
host all    all    ::1/128     trust 

その後、私は、ユーザーを作成して、それのためのパスワードを割り当てます。

postgres=# create role asunotest; 
CREATE ROLE 
postgres=# alter role asunotest with encrypted password '1234'; 
ALTER ROLE 

しかし、私を入れません:

-bash-4.2$ psql -h 127.0.0.1 -U asunotest 
Password for user asunotest: 1234 
psql: FATAL: role "asunotest" is not permitted to log in 

何が問題なのですか?

答えて

99

作成した役割がログインを許可されていません。私はない `psql`、どのように私はROLEを変更できるようにドキュメントhttp://www.postgresql.org/docs/9.0/static/sql-alterrole.html

ALTER ROLE "asunotest" WITH LOGIN; 
+1

を読みますか? –

+1

@ RomulusUrakagiTs'aiあなたはpostgresユーザーとしてログインする必要があります(sudo -u postgres psql postgres) –

関連する問題