加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

postgres-9.3 beta2安装

发布时间:2020-12-13 17:36:05 所属栏目:百科 来源:网络整理
导读:软件下载位置: http://www.postgresql.org/ftp/source/ postgresql-9.3beta2.tar.gz 安装时建议看一下文件INSTALL,里面有详细的说明。 (1)配置 tar zxvf postgresql-9.3beta2.tar.gz mkdir /home/wln/postgres9.3/intall ./configure --prefix=/home/wln/
软件下载位置: http://www.postgresql.org/ftp/source/
postgresql-9.3beta2.tar.gz

安装时建议看一下文件INSTALL,里面有详细的说明。

(1)配置
tar zxvf postgresql-9.3beta2.tar.gz
mkdir /home/wln/postgres9.3/intall
./configure --prefix=/home/wln/postgres9.3/intall--enable-debug
(2)编译
gmake
(3)安装
gmake install
(4)创建安装用户数据目录
mkdir /home/wln/postgres9.3/data
(6)初始化数据库
/home/wln/postgres9.3/install/bin/initdb -D /home/wln/postgres9.3 /data
初始化成功后显示:
Success. You can now start the database server using:

/home/wln/postgres9.3/install/bin/postgres -D /home/wln/postgres9.3/data
or
/home/wln/postgres9.3/install/bin/pg_ctl -D /home/wln/postgres9.3/data -l logfile start

(7)启动数据库
home/wln/postgres9.3/install/bin/pg_ctl -D /home/wln/postgres9.3/data -l logfile start

(8)添加环境变量到系统
add the following to your shell start-up file,such as
"~/.bash_profile" 或 "~/.bashrc" (or "/etc/profile",if you want it to affect all
users):
使其生效 source ~/.bashrc 或source ~/.bash_profile
追加下面内容到文件
PATH= /home/wln/postgres9.3/install/bin:$PATH
export PATH
export LD_LIBRARY_PATH=/home/wln/postgres9.3/install/lib:$LIBPATH

$PATH是本来的PATH的变量,这句话的意思是在原来的PATH的基础上,加上 /home/wln/postgres9.3/install/bin这个路径。

(9)查看数据库状态
pg_ctl status

(10)启动/停止数据库
pg_ctl start
pg_ctl stop
(11)进入数据库
psql -d postgres -p 5432
(默认的数据库端口5432,可以在postgresql.conf文件中更改port端口值)

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读