linux下安装Postgresql相关问题的解决

来源:互联网 发布:创玻璃优化软件 编辑:程序博客网 时间:2024/06/14 01:26

1.Ubuntu安装Postgresql很简单:sudo apt-get install postgresql-8.4即可。若你有受虐倾向,可以自己下source包进行make和make install,不过估计要进行蛮多配置。

2.安装完毕后,默认会有一个postgres账户。用命令"sudo passwd postgres"可以设置密码。

3.可以用sudo apt-get install pgadmin3进行安装pgadmin。

4.默认账户是用pgadmin链接不上的,需要创建新用户,新超级用户创建命令:createuser -P -d -a -e aaa,这时会提示输入密码,也输入aaa,那么就新建了一个aaa/aaa的超级用户。

如果还是连接不上,那么,

4.1修改psql安装目录/postgresql.conf文件,修改listen_addresses = '*',*表示监听所有ip。

4.2修改psql安装目录/pg_hba.conf文件,修改host all all ip(如10.69.33.22)/32 trust,表示允许这个ip的连接。

经过以上操作,pgsql算是安装好了。


如果希望用php链接pgsql,那么php需要在./configure --prefix=/usr/local/php  --with-pgsql=/etc/postgresql --with-apxs2=/usr/local/apache2.2/bin/apxs,然后重新make及make install。


原创粉丝点击