PostgreSQL 初步安装

服务器:centos

客户端:windows(pgAdmin)

1、服务器yum安装 地址:https://www.postgresql.org/download/linux/redhat/

  选择对应要安装的版本,服务器版本后自动会给出地址

 

 

 

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

dnf -qy module disable postgresql

dnf install postgresql12

dnf install postgresql12-server

/usr/pgsql-12/bin/postgresql-12-setup initdb
systemctl enable postgresql-12
systemctl start postgresql-12

错误说明:

  1、no pg_hba.conf entry for host "211.161.248.43"

安装目录下找到 /var/lib/pgsql/12/data/pg_hba.conf,找到“# IPv4 local connections:”

在其下加上请求连接的机器IP

host all all 127.0.0.1/32 md5

32是子网掩码的网段;md5是密码验证方法,可以改为trust

  2、0x0000274D/10061 

安装目录下找到/data/postgresql.conf,找到“#listen_addresses”
将其前面的注释符号"#"去掉,然后将值从"localhost"改为“*”

 最后重启服务

 

2、pgAdmin windows版下载地址:https://www.pgadmin.org/download/pgadmin-4-windows/

下载后直接下一步安装。

中文设置:【file】->【preferences】->【Miscellaneous】->user language】,确认即可。

 

posted @ 2020-02-20 14:16  caolingyi  阅读(348)  评论(0编辑  收藏  举报