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、完成。
本文详细介绍了如何在系统上安装并配置PostgreSQL数据库,包括安装步骤、修改默认密码、打开远程访问等关键操作。

被折叠的 条评论
为什么被折叠?



