Chinaunix首页 | 论坛 | 博客
  • 博客访问: 100056
  • 博文数量: 16
  • 博客积分: 530
  • 博客等级: 下士
  • 技术积分: 200
  • 用 户 组: 普通用户
  • 注册时间: 2010-11-17 23:25
文章分类

全部博文(16)

文章存档

2014年(1)

2012年(2)

2011年(11)

2010年(2)

我的朋友

分类: Mysql/postgreSQL

2011-11-19 11:48:22


0: login as root

1:wget

2:安装
rpm -ivh pgdg-centos-9.0-2.noarch.rpm

3: vi /etc/yum.repos.d/CentOS-Base.repo

[base] and [updates] sections. add

exclude=postgresql*

4: 安装 postgresql

yum check postgres*

yum install postgresql90-libs.x86_64
yum install postgresql90.x86_64
yum install postgresql90-devel.x86_64
yum install postgresql-server

5: 设置数据库

service postgresql-9.0 initdb
service postgresql-9.0 start

su - postgres

vi .bash_profile
添加
export PATH=/usr/pgsql-9.0/bin:$PATH
exit
su - postgres

cd $PGDATA
vi postgresql.conf
修改 listen_addresses = '*'

vi pg_hba.conf

在 # IPv4 local connections: 行后增加
host    all             all             192.168.xxx.0/24        md5

pg_ctl reload

6: 修改数据库 postgres 用户密码
psql
postgres=#

alter user postgres with password 'xxxxxx';

7: 创建用户、数据库

CREATE USER db_user1 WITH PASSWORD 'xxxxxx';
CREATE DATABASE testdb WITH OWNER = "db_user1" ENCODING = 'UTF8';
阅读(1349) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~