1、安装
?sudo apt-get install postgresql-8.4
2、修改默认密码
?sudo -u postgres psqlpostgres=# ALTER USER postgres WITH PASSWORD ‘123456’;
postgres=# \q
3、打开远程访问
?sudo vi /etc/postgresql/8.4/main/postgresql.conf
取消注释:#listen_addresses = ‘localhost’
改为:listen_addresses = ‘*’
取消注释:#password_encryption = on
改为:password_encryption = on
? sudo vi /etc/postgresql/8.4/main/pg_hba.conf
文件末添加行:# to allow your client visiting postgresql server
文件末添加行:host all all 0.0.0.0 0.0.0.0 md5
? sudo /etc/init.d/postgresql-8.4 restart
4、完成。
原文链接:https://www.f2er.com/postgresql/196543.html