go程序无法连接源数据库:ORA-00000: DPI-1047: Cannot locate a 64-bit Oracle Client library问题的解决

tech2023-02-02  106

golang编程语言,godror oracle驱动,程序部署到linux下面以后提示:

无法连接源数据库:ORA-00000: DPI-1047: Cannot locate a 64-bit Oracle Client library: "libclntsh.so: cannot open shared object file: No such file or directory". See https://oracle.github.io/odpi/doc/installation.html#linux for help

下载oracle-instantclient12.2-basic-12.2.0.1.0-1.x86_64.rpm安装以后不管用,需要配置linux的动态库搜索路径才可以,方法为:

 cd /etc/ld.so.conf.d/

vi oracle.conf

输入oracle instantclient rpm包自动安装的路径,我这里的是

/usr/lib/oracle/12.2/client64/lib/

存盘以后执行ldconfig即可。

最新回复(0)