Greenplum6.x客户端连接
一. 下载客户端(windows)
根据需要下载,这里点击windows版本
安装完运行
设置密码
pgAdmin
新建连接
输入数据源相关信息
二. linux客户端使用
#安装
[root@localhost tmp]# rpm -ivh greenplum-db-clients-6.18.2-rhel7-x86_64.rpm
#配置
[gpadmin@localhost ~]$ vi .bash_profile
##末尾增加如下内容
source /usr/local/greenplum-db-clients/greenplum_loaders_path.sh
#生效环境变量
[gpadmin@localhost ~]$ source .bash_profile
#连接数据库,需要输入密码
[gpadmin@localhost ~]$ psql -d gpdb -h 192.168.0.110 -p 5432 -U gpuser
#通常脚本中需要连接数据库
[gpadmin@localhost ~]$ PGPASSWORD='password' psql -d gpdb -h 192.168.0.110 -p 5432 -U gpuser -w
#或者
[gpadmin@localhost ~]$ PGPASSWORD='password' psql -d gpdb -h 192.168.0.110 -p 5432 -U gpuser
$或者如下,这种通过ps -ef|grep psql 会显示出明文密码,不安全
[gpadmin@localhost ~]$ psql "postgresql://gpuser:gpuser@192.168.0.110/gpdb"