postgresql部署 版本: 10.10 官方下载地址:https://www.postgresql.org/download/linux/redhat/ 一、安装pg # 安装yum源 yum inst
# 安装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.service Environment=PGDATA=/data/pgsql/data
初始化数据库
/usr/pgsql-10/bin/postgresql-10-setup initdb
设置开机启动 & 启动pg
systemctl enable postgresql-10
systemctl start postgresql-10
sudo -su postgres
psql
> 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
--结束END--
本文标题: postgresql部署
本文链接: https://www.lsjlt.com/news/5614.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-05-03
2024-05-03
2024-05-03
2024-05-03
2024-05-03
2024-05-03
2024-05-03
2024-05-03
2024-05-03
2024-05-03
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0