Macos 如何在mac os x 10.8.2上重置postgresql 9.2默认用户(通常为';postgres';)密码?
我刚刚将PostgreSQL 9.2从安装到Mac OS X 10.8.2上。我输入了我的Macos 如何在mac os x 10.8.2上重置postgresql 9.2默认用户(通常为';postgres';)密码?,macos,postgresql,Macos,Postgresql,我刚刚将PostgreSQL 9.2从安装到Mac OS X 10.8.2上。我输入了我的postgres用户密码,因此无法连接。如何重置密码?: 修改/Library/PostgreSQL/9.2/data/pg_hba.conf -local all all md5 +local all all trust 重新启动postgres /Library/PostgreSQL/9.2/bin/pg_ctl restart -D /Library/PostgreSQL/9.2/data/
postgres
用户密码,因此无法连接。如何重置密码?:
修改/Library/PostgreSQL/9.2/data/pg_hba.conf
-local all all md5
+local all all trust
重新启动postgres
/Library/PostgreSQL/9.2/bin/pg_ctl restart -D /Library/PostgreSQL/9.2/data/
/Library/PostgreSQL/9.2/bin/pg_ctl restart -D /Library/PostgreSQL/9.2/data/
连接到postgres:
psql
psql内部(\q
退出):
向后修改pg_hba.conf
+local all all md5
-local all all trust
重新启动postgres
/Library/PostgreSQL/9.2/bin/pg_ctl restart -D /Library/PostgreSQL/9.2/data/
/Library/PostgreSQL/9.2/bin/pg_ctl restart -D /Library/PostgreSQL/9.2/data/
更改pg_hba.conf后,无需重新启动Postgres。您只需要使用
pg_ctl reload
重新加载它。我必须在右postgres根目录中设置pg_DATA=pwd
/DATA才能运行pg_ctl restart。