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 postgresql13-server
sudo /usr/pgsql-13/bin/postgresql-13-setup initdb
sudo systemctl enable postgresql-13
sudo systemctl start postgresql-13

修改密码

  1. PostgreSQL登录(使用psql客户端登录)
    sudo -u postgres psql

  2. 修改PostgreSQL登录密码

ALTER USER postgres WITH PASSWORD 'postgres';

  1. 退出PostgreSQL psql客户端

输入 \q 退出

允许远程连接

默认情况下postgresql 是不允许远程连接的

进入目录

/var/lib/pgsql/13/data

1 . 编辑文件 pg_hba.conf

增加一行

host all all 0.0.0.0/0 trust

postgres 在centos 安装

  1. 编辑 postgresql.conf

将listen_addresses 修改成 *

listen_addresses = '*'

相关文章:

  • 2021-08-02
  • 2022-12-23
  • 2022-12-23
  • 2021-12-15
  • 2021-08-19
  • 2021-08-01
  • 2021-11-25
猜你喜欢
  • 2021-10-04
  • 2022-12-23
  • 2022-12-23
  • 2021-08-28
  • 2022-12-23
  • 2021-04-29
  • 2021-10-02
相关资源
相似解决方案