PostgreSQL

PostgreSQL

※前提条件:本情報はPostgreSQL 9.2 を基づいて説明してる

コマンドの使い方

\PostgreSQL\9.2\bin\initdb.exe -U postgres -A password -E UTF8 -D C:\Users\PostgreSQL\9.2\data --locale=C -W

説明:

-Uデータベースのユーザ名
-Aユーザログイン認証の方法
-Dデータベースデータの格納場所
-W-Uで指定したユーザのパスワードを強制的に入力させる

ユーザ認証方法

trustAllow the connection unconditionally. This method allows anyone that can connect to the PostgreSQL database server to login as any PostgreSQL user they like, without the need for a password.
rejectReject the connection unconditionally. This is useful for "filtering out" certain hosts from a group.
md5Require the client to supply an MD5-encrypted password for authentication.
passwordRequire the client to supply an unencrypted password for authentication. Since the password is sent in clear text over the network, this should not be used on untrusted networks.
gssUse GSSAPI to authenticate the user. This is only available for TCP/IP connections.
sspiUse SSPI to authenticate the user. This is only available on Windows.
krb5Use Kerberos V5 to authenticate the user. This is only available for TCP/IP connections.
identObtain the operating system user name of the client (for TCP/IP connections by contacting the ident server on the client, for local connections by getting it from the operating system) and check if it matches the requested database user name.
ldapAuthenticate using an LDAP server.
certAuthenticate using SSL client certificates.
pamAuthenticate using the Pluggable Authentication Modules (PAM) service provided by the operating system.

トラブルシューティング

initdbコマンドでデータベースの初期化に、バッチファイルを利用して、パスワード設定の自動化を図ろうとしたが、--pwfileパラメータがうまく動作できなく、以下の方法でパスワードを設定した。

手順1:以下のコマンドでデータベースを初期化する

\PostgreSQL\9.2\bin\initdb.exe -U postgres -A trust -E UTF8 -D C:\Users\PostgreSQL\9.2\data --locale=C

手順2:changePwd.sqlファイルを作成、中身を以下にする

alter user postgres with password 'new password';

手順3:パスワード修正ファイルを適用する

\PostgreSQL\9.2\bin\psql.exe -U postgres -f changePwd.sql


月額たった 1,050円で始められる本格的なお店のホームページ!

コメント:



(画像の文字列を入力して下さい)

トップ   編集 凍結 差分 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2019/12/02 (月) 12:31:58 (1628d)

yVoC[UNLIMITȂ1~] ECirŃ|C Yahoo yV LINEf[^[Ōz500~`I


z[y[W ̃NWbgJ[h COiq 萔O~ył񂫁z COsیI COze