postgresのパスワードを忘れた時
Posted: 2017年6月19日(月) 12:30
あまりにも多いので書いておく。
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
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