User-Profile-Image
hankin
  • 5
  • centos7
  • docker
  • mysql
  • PostgreSQL
  • git/gitlab
  • ELK
  • python
    • python-Tornado
    • python-django
  • redis
  • nginx
  • kvm
  • proxmox
  • mongo
  • kubernetes
  • prometheus
  • GlusterFs
  • nfs
  • freeswitch
  • httpd
  • shell脚本
  • linux
  • fastdfs
  • nextcloud
  • openssl
  • openvpn
  • rabbitmq
  • sqlite
  • svn
  • java
  • ubuntu
  • vue2
  • wordpress
  • php
  • IOT物联网
  • 项目
  • 故障处理
  • 树莓派
  • 博客存档
  • 未分类
  • 杂项
  • #1742(无标题)
  • 新视野
  • 分类
    • 项目
    • 树莓派
    • 杂项
    • 未分类
    • 新视野
    • 故障处理
    • 博客存档
    • wordpress
    • vue2
    • ubuntu
    • svn
    • sqlite
    • shell脚本
    • redis
    • rabbitmq
    • python-django
    • python
    • proxmox
    • prometheus
    • PostgreSQL
    • php
    • openvpn
    • openssl
    • nginx
    • nfs
    • nextcloud
    • mysql
    • mongo
    • linux
    • kvm
    • kubernetes
    • java
    • IOT物联网
    • httpd
    • GlusterFs
    • git/gitlab
    • freeswitch
    • fastdfs
    • ELK
    • docker
    • centos7
  • 页面
    • #1742(无标题)
  • 友链
      请到[后台->主题设置->友情链接]中设置。
Help?

Please contact us on our email for need any support

Support
    首页   ›   PostgreSQL   ›   正文
PostgreSQL

centos7安装PostgreSQL15

2023-04-27 17:37:22
1100  0 0
准备
#官方下载https://www.postgresql.org/download/
#https://www.postgresql.org/download/linux/redhat/
安装
安装步骤参考自官网
sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
sudo yum install -y postgresql15-server
sudo /usr/pgsql-15/bin/postgresql-15-setup initdb
sudo systemctl enable postgresql-15
sudo systemctl start postgresql-15
配置
配置文件 /var/lib/pgsql/15/data/postgresql.conf

修改密码
    sudo -u postgres psql
    could not change directory to "/root": Permission denied
    psql (15.2)
    Type "help" for help.

    postgres=# \password postgres
    Enter new password for user "postgres": 
    Enter it again: 
    postgres=# 

    #其他 su - postgres , psql
开启远程访问
echo "listen_addresses = '*'" >> /var/lib/pgsql/15/data/postgresql.conf
systemctl restart postgresql-15
ss -natl |grep 5432 #查看监听是否正常
使用navicat12连接
echo "host    all             all             0.0.0.0/0               password" >> /var/lib/pgsql/15/data/pg_hba.conf

    #如果不是password认证方式 ,navicat 12连不上
systemctl restart postgresql-15
navicat12中连接

    #navicat12打开pg15的库可能会报错ERROR:column "datlastsysoid" does not existm,LINE 1:select distinct datlastsysoid from pg_database;因为新的PgSQL15查询到的主键是sid
    #pg14不会
操作
\l;
\c db1;
create database db1;
drop databases db1;
评论 (0)

点击这里取消回复。

欢迎您 游客  

Copyright © 2025 网站备案号 : 蜀ICP备2022017747号
smarty_hankin 主题. Designed by hankin
主页
页面
  • #1742(无标题)
博主
tang.show
tang.show 管理员
linux、centos、docker 、k8s、mysql等技术相关的总结文档
210 文章 2 评论 196274 浏览
测试
测试