postgresql及phppgadmin的安装与配置

最近在学校等着毕业,空余时间挺多的,就想捣鼓些没用过的新玩意,比如PostgreSQL。听说它功能丰富,性能,可靠性也不错。 我用的是Debian7,系统源的版本是9.1,而官方最新的是9.2,好在官方提供了一个源,可以安装最新版,这个在官网有,详情不表。 安装也简单,apt-get install 就可以。关键是配置, 网上资料很多,这个算是挺靠谱的, https://help.ubuntu.com/10.04/serverguide/postgresql.html http://wiki.ubuntu.org.cn/PostgreSQL

sudo -u postgres psql template1

ALTER USER postgres with encrypted password 'your_password'; 
#your_password为你要设置的密码

#也可以这样重置密码
sudo passwd postgres

#然后修改  /etc/postgresql/9.2/main/pg_hba.conf,加上这一行。一定要加到最前面,否则无法登陆
#提示 provided username (postgres) and authenticated user name (www-data) do not match
local   all         postgres                          md5
#管理工具我用的phpPgAdmin,注意,直接是没法登陆的,需要将conf/config.inc.php中的extra_login_security设置为false
$conf['extra_login_security'] = false
#这样就可以用postgres这个账户和你设置的密码登陆了
2,733 views, since 2013-05-24