LoginSignup
0
0

More than 3 years have passed since last update.

postgresSQLで初期接続ができなかった。

Posted at

psql -U postgres で接続できない

サーバー起動

とりあえずpostgresSQLのサーバーを起動
10分くらいサーバー起動せずにCommand叩いてました。笑

$ postgres -D /usr/local/var/postgres

接続できない。

roleのpostgresが無いらしい。。。

$ psql -U postgres
psql: FATAL:  role "postgres" does not exist

データベースの一覧を確認

僕の場合はこの時点でOwnerのところのユーザーを使えば接続できました。

$ psql -l

// DBのOwnerのユーザーでログイン
$ psql -U {userName} {dbName}

残る疑問

なぜデフォルトであるはずのpostgresのroleが無かったのか。
今回は別のユーザーでは入れたので問題無いけれど…

一応参考
https://eng-entrance.com/postgresql-role

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0