Postgresql 在 centos7 上的安装配置运行

下载安装

从 https://www.postgresql.org/download/ 下载合适的版本

./configure

make && make install

即可

利用Centos7 的镜像安装

参考: https://www.postgresql.org/download/linux/redhat/

根据提示选择平台

安装RPM 库

yum install https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-7-x86_64/pgdg-centos11-11-2.noarch.rpm

这是客户端

yum install postgresql11

服务端

yum install postgresql11-server

初始化数据库 并且开启自启动

/usr/pgsql-11/bin/postgresql-11-setup initdb

systemctl enable postgresql-11

systemctl start postgresql-11

即可

Postgresql.conf 的配置文件

#listen_addresses = 'localhost' # what IP address(es) to listen on;

# comma-separated list of addresses; # defaults to 'localhost'; use '*' for all # (change requires restart)
#port = 5432 # (change requires restart)
max_connections = 100 # (change requires restart)
#superuser_reserved_connections = 3 # (change requires restart) 为管理员保留的专用连接数,普通用户无法使用这些连接
shared_buffers = 128MB # min 128kB 共享缓存 非常重要的参数