最近在学校等着毕业,空余时间挺多的,就想捣鼓些没用过的新玩意,比如PostgreSQL。听说它功能丰富,性能、可靠性也不错。 我用的是 Debian 7,系统源的版本是9.1,而官方最新的是9.2,好在官方提供了一个源,可以安装最新版,具体配置方法见官网,此处不再赘述。 安装也简单,apt-get install 就可以。关键是配置, 网上资料很多,这个算是挺靠谱的,
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 这个账户和你设置的密码登录了
About this article
- Author
- Lerry
- Published
- 2013-05-24
- License
- CC BY-NC-ND 4.0