linux (CentOS 7) 下安装 postgresql 10

GDAL  调用 PostGreSQL10 

需要下载windows 下的库文件和头文件 版本:postgresql-10.3-1-windows-binaries

linux 下安装 postgresql-10.3-1

1.基础安装

(1)yum install https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-centos10-10-2.noarch.rpm

(2)yum install postgresql10

(3)yum install postgresql10-server

2.更改配置,允许远程访问

linux 下配置文件全路 var/lib/pgsql/10/data/pg_hba.conf


添加红色行,更改绿色字符

linux 下配置文件全路 var/lib/pgsql/10/data/postgresql.conf


更改红色框内配置文件.

3.修改密码

[root@psql_master ~]# su - postgres

#切换用户后,提示符变更为“-bash-4.2$”;
#同时数据库中也会生成一个名为”postgres”的数据库用户,且密码已自动生成;
#PostgreSQL在数据库用户同名的系统账号下登录免密;
-bash-4.2$ psql -U postgres

#进入数据库后修改密码;
postgres=# alter user postgres with password '1234'
4.启动命令

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

systemctl enable postgresql-10

systemctl start postgresql-10

systemctl restart postgresql-10


猜你喜欢

转载自blog.csdn.net/u012453032/article/details/79483497