Linux使用yum命令安装postgrepsql

1.检查安装源

yum search postgresql

2.安装

yum install postgresql-server

3.启动数据库

service postgresql start

4.查看启动状态

service postgresql status

5.登陆测试

su - postgrep
psql
\l

6.远程连接

6.1修改配置文件

在pg_hba.conf增加host all all 0.0.0.0/0 trust

Linux使用yum命令安装postgrepsql_第1张图片

在postgresql.conf找到“listen_addresses“参数后,设置listen_addresses = ‘*’,保存。

Linux使用yum命令安装postgrepsql_第2张图片

6.2云服务器需要在安全组开放对应的端口

6.2重启

service postgresql restart

你可能感兴趣的:(linux,运维,服务器)