LoginSignup
0
1

More than 3 years have passed since last update.

【postgreSQL】psqlでのログイン

Last updated at Posted at 2019-06-03

備忘録として残します。

普段mysqlなので忘れちゃいますね。

■やり方

オプションは大文字小文字しっかりと区別するので、下記の通りにすること。

DB指定してログイン

#psql -U <ロール名(ユーザ名)> -d <DB名>
psql -U postgres -d testdb

普通にログインしてからDBを指定

#ログインだけ
#psql -U <ロール名(ユーザ名)>
psql -U postgres
#ログイン後にDB指定
#\c <DB名>   mysqlで言うところの USE DB名
\c testdb
0
1
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
1