postgresql部署
postgresql部署
版本: 10.10
官方下载地址:https://www.postgresql.org/download/linux/redhat/
一、安装pg
# 安装yum源yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
# 安装pg相关包
yum install postgresql10
yum install postgresql10-server
修改pg数据路径
vi /usr/lib/systemd/system/postgresql-10.serviceEnvironment=PGDATA=/data/pgsql/data
初始化数据库
/usr/pgsql-10/bin/postgresql-10-setup initdb
设置开机启动 & 启动pg
systemctl enable postgresql-10
systemctl start postgresql-10
二、创建账号
sudo -su postgrespsql
> CREATE ROLE yunxi superuser PASSWORD "Yunxi711" login;
>
# 修改密码
alter user yunxi with password "Yunxi711";
# 修改配置文件 加入如下项
vi /data/pgsql/data/postgresql.conf
> listen_addresses = "*"
vi pg_hba.conf
> host all all 0.0.0.0/0 md5
# 重启pg
systemctl restart postgresql-10
以上是 postgresql部署 的全部内容, 来源链接: utcz.com/z/533216.html