Home  >  Article  >  Database  >  只安装PostgreSQL客户端工具psql的方法

只安装PostgreSQL客户端工具psql的方法

WBOY
WBOYOriginal
2016-06-07 14:58:591955browse

只安装PostgreSQL客户端工具psql的方法 最近有个项目,客户用了edb的ppas,没有只安装psql的安装包,客户表示有些不便,就有了下面的DIY,绿色的。postgresql上应该一样,没做测试。思路就是把psql依赖的包和psql搞到一起切让psql执行时能找到并加载就OK了。

只安装PostgreSQL客户端工具psql的方法

 

最近有个项目,客户用了edb的ppas,没有只安装psql的安装包,客户表示有些不便,就有了下面的DIY,绿色的。postgresql上应该一样,没做测试。思路就是把psql依赖的包和psql搞到一起切让psql执行时能找到并加载就OK了。具体步骤见下面

 

1

1.1

只安装psql客户端的问题在windows上只要从edb服务器上把下面的文件copy到客户端上(服务器和客户端机应该同为32或64位)

libeay32.dll 

libintl-8.dll

libpq.dll    

psql.exe     

ssleay32.dll

 

1.2

然后如下就可以了:

E:\psql>psql.exe -h 192.168.1.117 -p 5444 -U enterprisedb beigang

Password for user enterprisedb:

psql (9.2.1.3)

Type "help" for help.

beigang=#

 

2

2.1

建立文件夹psql_client,在里面建立lib子文件夹把psql拷贝到psql_client,把libcrypto.so.1.0.0、libpq.so.5、libssl.so.1.0.0拷贝到lib

 

[root@hadoopDataNode1 Desktop]# ll

total 4

drwxr-xr-x. 3 root root 4096 May 30 16:40 psql_client

 

[root@hadoopDataNode1 Desktop]# ll psql_client/

total 552

drwxr-xr-x. 2 root root   4096 May 30 16:46 lib

-rwxr-xr-x. 1 root root 559397 May 30 16:40 psql

 

[root@hadoopDataNode1 Desktop]# ll psql_client/lib/

total 2736

-rw-r--r--. 1 root root 2126936 May 30 16:46 libcrypto.so.1.0.0

-rw-r--r--. 1 root root  209505 May 30 16:45 libpq.so.5

-rw-r--r--. 1 root root  455094 May 30 16:45 libssl.so.1.0.0

 

2.2

在/etc/ld.so.conf.d/里创建文件psql_client.conf,里面写上/root/Desktop/psql_client/lib/

[root@hadoopDataNode1 psql_client]# cat /etc/ld.so.conf.d/psql_client.conf 

/root/Desktop/psql_client/lib/

 

2.3

在命令行里执行ldconfig

 

2.4

然后用psql登录数据库

Server:~/Desktop/psql_client # ./psql -U enterprisedb beigang

[root@Server psql_client]# ./psql -h 192.168.10.55 -p 5444 -U enterprisedb beigang

Password for user enterprisedb: 

psql (9.2.0.1)

Type "help" for help.

beigang=#

 

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:Redis环境的安装与测试Next article:mongodb入门-5插入