下载
yum install https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-7-x86_64/pgdg-redhat11-11-2.noarch.rpm -y
安装
yum -y install postgresql11 postgresql11-server postgresql11-libs
初始化数据库
/usr/pgsql-11/bin/postgresql-11-setup initdb
设置开机自启动PostgreSQL和启动服务
systemctl enable postgresql-11
systemctl start postgresql-11
systemctl status postgresql-11
登录数据库,这里切换账号postgres
su - postgres
psql
Navicat连接PostgreSQL
这里要修改配置文件postgresql.conf
find / -name postgresql.conf
vi /var/lib/pgsql/11/data/postgresql.conf
找到listen_address那里,解开注释并修改引号内localhost的值为*
listen_address="*"
保存并退出,重启postgresql服务

这篇博客详细介绍了在CentOS系统上安装PostgreSQL的过程,包括下载安装包、初始化数据库、修改配置允许远程连接、设置数据库用户密码,以及进行基本的数据库操作,如创建、删除数据库和执行SQL查询。
最低0.47元/天 解锁文章
454

被折叠的 条评论
为什么被折叠?



