PostgreSql: 安装与链接

1,714 阅读1分钟

环境介绍

使用宝塔面板,在阿里云中安装PostgreSql,并使用DataGrip在本地进行链接

postgresql 配置

安装postgresql

在宝塔中安装postgresql 管理器 image 在此处点击安装postgresql , 我安装的是14.2。各位可以自行选择 image 之后等待安装完成即可

修改配置文件

修改postgresql.conf

image

修改pg_hba.conf

图片.png

重启

image

阿里云服务器

添加安全组

image

让端口通过防火墙

firewall-cmd --zone=public --add-port=5432/tcp --permanent  // 通过防火墙
firewall-cmd --reload  // 重启防火墙

DataGrip

使用DataGrip,选择postgresql进行链接。需要注意的点如下:

  • 默认数据库: postgres
  • port: 5432
  • 默认用户名: postgres
  • 默认密码: postgres

参考链接

blog.csdn.net/u011677255/… www.jianshu.com/p/f246dc45e…