Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2787714
  • 博文数量: 423
  • 博客积分: 7770
  • 博客等级: 少将
  • 技术积分: 4766
  • 用 户 组: 普通用户
  • 注册时间: 2006-11-09 11:58
个人简介

Oracle/DB2/Postgresql/Mysql/Hadoop/Greenplum/Postgres-xl/Mongodb

文章分类

全部博文(423)

文章存档

2019年(3)

2018年(6)

2017年(27)

2016年(23)

2015年(30)

2014年(16)

2013年(31)

2012年(73)

2011年(45)

2010年(14)

2009年(30)

2008年(30)

2007年(63)

2006年(32)

分类: Mysql/postgreSQL

2008-01-02 23:50:20

                      Postgresql 安装、备份、还原
./configure
gmake
su
gmake install
adduser postgres
mkdir /usr/local/pgsql/data
chown postgres /usr/local/pgsql/data
su - postgres
export LANG=zh_CN.UTF8
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data -E UTF8
/usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data >logfile 2>&1 &
/usr/local/pgsql/bin/createdb than
/usr/local/pgsql/bin/psql test
# ./pg_ctl -D /usr/local/pgsql/data start (启动)
# ./pg_ctl -D /usr/local/pgsql/data stop(关闭)
接下来,就是安装配置 windowns版的管理工具:pgAdmin III
由于postgresql默认没有开启监听端口,下面需要在服务器端做一些设置:
修改postgresql数据库配置文件
$ vi /usr/local/pgsql/data/postgresql.conf
#---------------------------------------------------------------------------
# CONNECTIONS AND AUTHENTICATION
#---------------------------------------------------------------------------
# - Connection Settings -
listen_addresses = '*'  # what IP address(es) to listen on;
                                        # comma-separated list of addresses;
                                        # defaults to 'localhost', '*' = all
                                        # (change requires restart)
port = 5432                             # (change requires restart)
max_connections = 100                   # (change requires restart)
# Note: increasing max_connections costs ~400 bytes of shared memory per
# connection slot, plus lock space (see max_locks_per_transaction).  You
# might also need to raise shared_buffers to support more connections.
superuser_reserved_connections = 3      # (change requires restart)
unix_socket_directory = ''              # (change requires restart)
unix_socket_group = ''                  # (change requires restart)
unix_socket_permissions = 0777          # octal
                                        # (change requires restart)
#bonjour_name = ''                      # defaults to the computer name
修改客户端配置文件
$  vi /usr/local/pgsql/data/pg_hba.conf
 

# "local" is for Unix domain socket connections only
local   all         all                               trust
#IPv4 local connections:
host    all         all         192.168.1.0/24          trust

下面下载pgAdmin III 安装,连接就可以很方便的管理了,

alter user postgres password '6220104'; //设置postgres用户密码
CREATE SCHEMA tank AUTHORIZATION tank; //指定tank用户下的默认schema为tank

 
阅读(2442) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~