一、前置准备
参考网站:
官网下载安装方式:https://www.postgresql.org/download/linux/redhat/
安装版本:PostgreSQL11
系统版本:CentOS7
二、开始安装
1)通过yum进行安装
yum install postgresql-server
2)初始化数据库
postgresql-setup initdb
安装完成。(操作真简单- -、)
三、初期配置
1)启动相关
#开机启动
systemctl enable postgresql.service
#启动
systemctl start postgresql.service
#重启
systemctl restart postgresql.service
#查看状态
systemctl status postgresql.service
#停止
systemctl stop postgresql.service
2)简单配置
a,设置密码
#切换用户环境
su - postgres
#进入pgsql
psql -U postgres
#修改密码
alter user postgres with password 'new password';
#退出
\q
#退出当前用户
exit
b,修改配置文件
配置文件路径&#x