https://www.postgresql.org/download/

选择相应的版本

PostgreSQL CentOS 7 安装配置

 

 

 安装完成后,稍微配置下,否则无法远程访问:

cd /var/lib/pgsql/11/data

vi postgresql.conf

增加

listen_addresses = '*'
port = 9310

端口可以使用默认端口不做修改

vi pg_hba.conf

增加

host all all 0.0.0.0/0 md5

 

新建用户

su - postgres

psql -p 9310

postgres=# CREATE USER dbuser WITH PASSWORD '*****';

postgres=# CREATE DATABASE exampledb OWNER dbuser;

postgres=# GRANT ALL PRIVILEGES ON DATABASE exampledb TO dbuser;

 

补充下安装控件

yum install postgresql11-contrib

授权:

postgres=# alter user dbuser with SUPERUSER;

 

相关文章:

  • 2022-01-12
  • 2021-12-21
  • 2021-07-19
  • 2021-05-18
  • 2022-12-23
  • 2021-08-15
  • 2021-10-17
猜你喜欢
  • 2022-01-05
  • 2022-12-23
  • 2022-03-03
  • 2021-12-08
  • 2021-04-28
  • 2022-12-23
相关资源
相似解决方案