fedora27(centos)下用过dnf(yum)安装postgresql10

安装postgresql10-server

所有repo包都在 https://yum.postgresql.org/下,这里通过一级一级,先是postgresql10版本,然后选择fedora 10,然后下载安装

dnf install https://download.postgresql.org/pub/repos/yum/10/fedora/fedora-27-x86_64/pgdg-fedora10-10-3.noarch.rpm dnf install postgresql10-server

安装 pgadmin4

dnf install pgadmin4-v2

初始化数据库

sudo /usr/pgsql-10/bin/postgresql-10-setup initdb

运行数据库

系统服务被安装在/usr/lib/systemd/system/postgresql-10.service

systemctl start postgresql-10
systemctl enable postgresql-10

修改本地登录无需密码

sudo vim /var/lib/pgsql/10/data/pg_hba.conf

#host    all             all             127.0.0.1/32            ident
host    all             all             127.0.0.1/32            trust