标签:arch tor postgres post sys nbsp 初始 pre usr
数据库版本:postgresql9.6
系统环境:CentOS 6/7 x86_64
yum install -y https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-6-x86_64/pgdg-centos96-9.6-3.noarch.rpm
yum install -y https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-redhat96-9.6-3.noarch.rpm
yum install -y postgresql96-server
postresql的存储路径为 /var/lib/pgsql/9.6/data
可以通过修改postgresql的PGDATA改变存储路径。比如以/mnt/data/pgsql为例,编辑/usr/lib/systemd/system/postgresql-9.6.service
Environment=PGDATA=/mnt/data/pgsql # 修改PGDATA
新建和修改文件权限
mkdir -p /mnt/data/pgsql chown -R postgres:postgres /mnt/data/pgsql
service postgresql-9.6 initdb
/usr/pgsql-9.6/bin/postgresql96-setup initdb
chkconfig postgresql-9.6 on
service postgresql-9.6 start
systemctl enable postgresql-9.6
systemctl start postgresql-9.6
标签:arch tor postgres post sys nbsp 初始 pre usr
原文地址:https://www.cnblogs.com/miclis/p/10480489.html