centos postgresql

前端之家收集整理的这篇文章主要介绍了centos postgresql前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

https://yum.postgresql.org/repopackages.php

sudo yum install http://yum.postgresql.org/9.5/redhat/rhel-7-x86_64/pgdg-redhat95-9.5-2.noarch.rpm -y

yum list postgresql*
useradd postgres
yum install postgresql10-server.x86_64

默认情况下,Postgresql安装目录是/usr/pgsql-10,而Postgresql的数据目录是/var/lib/pgsql/版本号/data目录
[root@localhost ~]# mkdir postgres /var/lib/pgsql/10/data
初始化数据库
[root@localhost ~]# /usr/pgsql-10/bin/postgresql-10-setup initdb
Initializing database … OK

[root@localhost ~]# su - postgres

[postgres@localhost ~]$ /usr/pgsql-10/bin/pg_ctl -D /var/lib/pgsql/10/data start

[postgres@localhost ~]$ /usr/pgsql-10/bin/psql -p 5432

原文链接:https://www.f2er.com/centos/375616.html

猜你在找的CentOS相关文章