问题驱动
[root@tengine2test .OpsScripts]# PGPASSWORD=1234567899 psql -h 10.12.1.203 -U postgres -p 5432
-bash: psql: command not found
如上,我在应用服务器(只有应用),想要远程到数据服务器(含pgsql数据库)的数据库。如果是本地登陆的话,是可以登陆的。远程的话,提示没有这个指令。我又不想在应用服务器安装数据库,该怎么办呢?
问题解决
安装客户端,我天真的以为可以这样做。那到底能不能这样做呢?咋们试试吧!
下载红帽子安装包:
yum install https://download.postgresql.org/pub/repos/yum/9.4/redhat/rhel-7-x86_64/pgdg-redhat94-9.4-3.noarch.rpm
强行安装到centos上
yum install postgresql94
如图,他需要安装11版本的,只能重新安装了,如下:
卸载刚刚安装的版本(活着就是折腾):
yum remove postgresql94
下载安装包
yum install https://download.postgresql.org/pub/repos/yum/11/redhat/rhel-7-x86_64/pgdg-centos11-11-2.noarch.rpm
安装
yum install postgresql11