繁体   English   中英

如何在mac os x 10.8.2上重置postgresql 9.2默认用户(通常是'postgres')密码?

[英]How do I reset the postgresql 9.2 default user (usually 'postgres') password on mac os x 10.8.2?

我刚从enterpriseedb安装了PostgreSQL 9.2Mac OS X 10.8.2 我错误输入了我的postgres用户密码,所以无法连接。 如何重置密码?

找到方向

sudo su 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:

psql

在psql里面( \\q退出):

ALTER USER postgres WITH ENCRYPTED PASSWORD 'password';

修改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/

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM