Centos7.4 使用 yum 安装 PostgreSql v10

转自 https://www.csdn.net/tags/NtDaMgwsNjQ3MTgtYmxvZwO0O0OO0O0O.html

 

1、浏览器打开 https://www.postgresql.org/download/linux/redhat/ 

、安装资源 rpm 、客户端、服务端

yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm

yum install -y postgresql10

yum install -y postgresql10-server 

2、数据库初始化

/usr/pgsql-10/bin/postgresql-10-setup initdb

3、设置允许外部连接

查看目录

vim /var/lib/pgsql/10/data/postgresql.conf

vim /var/lib/pgsql/10/data/pg_hba.conf

host all all 0.0.0.0/0 md5

4、防火墙开放 5432 端口(条件允许可关闭防火墙)

5、 postgresql 安装目录授权 chown postgres:root -R /usr/pgsql-10/

6、启动服务systemctl start postgresql-10

netstat -lntp

7、切换用户,设置数据库密码

su - postgres

psql -U postgres

ALTER USER postgres with encrypted password '123456';

posted on   空明流光  阅读(474)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 展开说说关于C#中ORM框架的用法!
历史上的今天:
2020-05-06 Cent OS vsftp 配置

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示