当前位置:Gxlcms > 数据库问题 > PostgreSQL安装与配置详解

PostgreSQL安装与配置详解

时间:2021-07-01 10:21:17 帮助过:4人阅读

安装: 
sudo apt-get install postgresql


设置密码
sudo -u postgres psql 
postgres=# ALTER USER postgres WITH PASSWORD ‘postgres’;
postgres=# \q


sudo passwd -d postgres
sudo -u postgres passwd


更改配置文件
sudo vim /etc/postgresql/8.4/main/postgresql.conf
listen_addresses = ‘*’ 
password_encryption = on


sudo vim /etc/postgresql/8.4/main/pg_hba.conf 
host all all 0.0.0.0/0 md5
sudo /etc/init.d/postgresql restart


测试连接
psql -U postgres -h 127.0.0.1
postgres=#


安装GUI管理工具
sudo apt-get install pgadmin3


卸载
dpkg --list | grep postgresql 
dpkg --purge
以后重新安装使用aptitude安装PostgreSQL,可以重新获得所有配置文件

http://blog.chinaunix.net/uid-25885064-id-3404550.html

PostgreSQL安装与配置详解

标签:

人气教程排行