POSTGRESQL 9.1 FATAL: password authentication failed for user "postgres"


1.配置postgreql 可以遠程訪問:

sudo vim /etc/postgresql/9.1/main/postgresql.conf

root@ubuntuserver:~# sudo vi /etc/postgresql/9.1/main/postgresql.conf
—>改變行:#listen_addresses = ‘localhost’
—>修改為:listen_addresses = ‘*’
—>改變行:#password_encryption = on
—>修改為:password_encryption = on
root@ubuntuserver:~# sudo vi /etc/postgresql/9.1/main/pg_hba.conf
—>文件末添加行:# to allow your client visiting postgresql server
—>文件末添加行:host all all 0.0.0.0 0.0.0.0 md5
root@ubuntuserver:~# sudo /etc/init.d/postgresql-9.1 restart

2.修改默認的postgres 密碼 

sudo -u postgres psql template1


ALTER USER postgres with encrypted password 'your_password'

3.重啟POSTGRESQL服務

sudo /etc/init.d/postgresql-9.1 restart


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM