最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
CentOS系统安装 PostgreSQL9.4例子
时间:2022-06-30 21:12:18 编辑:袖梨 来源:一聚教程网
添加软件源,以 PostgreSQL 9.4 为例
yum install http://yum.p*o*stgr*esql.org/9.4/redhat/rhel-6-x86_64/pgdg-redhat94-9.4-1.noarch.rpm
安装数据库
yum -y install postgresql-server postgresql94 postgresql94-devel
建立数据库目录并赋予 postgres 用户权限
mkdir -p /home/pgsql/data
chown -R postgres:postgres /home/pgsql/
切换用户并初始化数据库目录
su - postgres
/usr/pgsql-9.4/bin/initdb -D /home/pgsql/data/ -E UTF-8 --locale=en_US.UTF-8
使用 root 用户修改启动脚本
vim /etc/init.d/postgresql-9.4
PGDATA=/home/pgsql/data # 将 PGDATA 的值改为新建的数据库目录
启动数据库
/etc/init.d/postgresql-9.4 start
相关文章
- 原神爱诺培养攻略 爱诺全方位养成攻略 09-14
- 原神爱诺怎么配队 爱诺配队大全攻略 09-14
- 超级机器人大战Y寺田生日是什么 制作人彩蛋说明 09-14
- 原神爱诺梦伊爱欧队怎么配队 爱诺配队大全 09-14
- 超级机器人大战Y特别生日怎么设置 4月20日B型效果说明 09-14
- 超级机器人大战Y前期机体怎么选 强力机体推荐攻略 09-14