postgresのパスワードを忘れた時

返信する
choco
管理人
記事: 279
登録日時: 2011年5月30日(月) 10:44

postgresのパスワードを忘れた時

投稿記事 by choco »

あまりにも多いので書いておく。

1.「pg_hba.conf」の修正
認証方式を3種類全て、「trust」に書き換える。

2.postgresqlを再起動する。

3.パスワードを設定する。
su postgres
psql -U postgres
alter role postgres with password 'xxxxxxx';

4.「pg_hba.conf」の修正
認証方式を3種類全て、「md5」に書き換える。

5.postgresqlを再起動する。

6.ログインして確認
su postgres
psql -U postgres
これで上記で設定したパスワードでログインできればOK
返信する