linux安装postgresql 8.3步骤
来源:互联网 发布:centos ping不通 编辑:程序博客网 时间:2024/06/05 02:06
http://www.cnblogs.com/dengbing/archive/2009/03/23/1419343.html
1、下载postgresql最新版:http://www.postgresql.org/ftp/source/
2、解压文件:
tar zxvf postgresql-8.3.7.tar.gz
cd postgresql-8.3.7
3、配置:
./configure --prefix=/usr/local/pgsql
4、编译:
make
5、安装:
make install
6、创建用户组和用户:
groupadd postgres
useradd -g postgres postgres
7、创建数据库库文件存储目录、给postgres赋予权限:
mkdir /usr/local/pgsql/data
cd /usr/local/pgsql
chown postgres.postgres data
8、初始化数据库目录:
切换用户
su - postgresql
初始化数据
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
启动数据库
/usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data
9、配置监听地址和端口:
vi /usr/local/pgsql/data/postgresql.conf
取消以下两行的注释
listen_addresses = '*'
port = 5432
10、允许远程连接:
vi /usr/local/pgsql/data/pg_hba.conf
添加
host all all 192.168.1.0/24 trust
每项的具体意思在配置文件中有详细说明
配置iptables让远程主机能访问:
vi /etc/sysconfig
添加
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5432 -j ACCEPT
service iptables restart
11、让postgresql数据库随系统启动而启动:
将启动脚本拷贝到/etc/init.d/目录下,具体执行如下命令:
cd /etc/rc.d/init.d
cp (第一步解压的安装文件目录)/postgresql-8.3.7/contrib/start-scripts/linux postgresql
chmod +x postgresql
vi postgresql
prefix=/usr/local/pgsql
PGDATA="/usr/local/pgsql/data"
PGUSER=postgres
PGLOG="/var/log/pgsql.log"
chkconfig --add postgresql
启动数据库:
service postgresql start
配置完毕 。
- linux安装postgresql 8.3步骤
- linux安装postgresql 8.3步骤
- PostgreSQL 二进制安装步骤
- PostgreSQL 二进制安装步骤
- RedHat5.5 安装Postgresql步骤
- PostgreSQL安装详细步骤(windows)
- linux上安装postgresql
- Linux下postgresql 安装
- linux下安装PostgreSQL
- linux安装postgresql数据库
- Linux安装PostgreSQL 9.4
- Linux Postgresql 安装,使用
- Linux下postgresql安装
- linux安装postgreSQL
- linuX安装postgresql地址
- postgresql Linux 二进制文件安装
- linux安装postgresql
- postgresql 9.4 在linux(Centos)环境的安装步骤详解
- 关于socket编程中的accept问题
- 十大高明的Google搜索技巧
- VC++2005mfc对话框添加背景图片
- 最近有几个服务必须要在启动电脑后登陆才能使用,于是想到了登陆后锁屏
- 任正非的用人术
- linux安装postgresql 8.3步骤
- 赚钱的8大定律
- Google顶级搜索引擎搜索方法使用技巧大全(一)
- BW:Query execution:Authorization Check Logic
- c语言字符串 数字转换函数大全转(自用)
- Iphone 视频教程
- 我选总经理的八道题
- 在WinCE中实现Screen Rotation(屏幕旋转)
- 内存对齐