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 @   caolingyi  阅读(359)  评论(0编辑  收藏  举报
编辑推荐:
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 从HTTP原因短语缺失研究HTTP/2和HTTP/3的设计差异
· 三行代码完成国际化适配,妙~啊~
点击右上角即可分享
微信分享提示