六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 320|回复: 0

在ubuntu 9.04配置postgresql数据库

[复制链接]

升级  74%

9

主题

9

主题

9

主题

童生

Rank: 1

积分
37
 楼主| 发表于 2013-1-30 01:38:55 | 显示全部楼层 |阅读模式
1 安装postgresql数据库

sudo apt-get install postgresql
也可以安装pgadmin3
sudo apt-get install pgadmin3

2 配置postgres文件

编辑 /etc/postgresql/.../pg_hba.conf, 修改如下:
local all all trust
host all all 127.0.0.1/32 trust
host all all ::1/128 trust
host all all 0.0.0.0/0 md5

3 重启postgresql服务器

sudo /etc/init.d/postgres restart

4 测试数据库

psql -U postgres -l

5 其中一些有用的命令

创建和删除数据库,用户
createdb/dropdb mydb
createsuer -U postgres -P myuser 会提示是否设置和超级用户
dropuser -U postgres myuser
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表