Cannot locate a 64-bit Oracle Client library: “libclntsh.so: cannot open shared object file: No such

在Linux服务器上,后端代码尝试连接Oracle数据库时遇到错误,提示无法找到64位Oracle客户端库libclntsh.so。为解决问题,需下载并安装OracleInstantClient,将其放在正确路径下,并运行ldconfig更新链接器配置。然而,在执行ldd检查时,仍发现缺少几个包。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

今天发现在服务器上的后端代码连接oracle数据库时连接不上,以下是报错信息

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/node-oracledb/INSTALL.html for help
Node-oracledb installation instructions: https://oracle.github.io/node-oracledb/INSTALL.html
You must have 64-bit Oracle Client libraries configured with ldconfig, or in LD_LIBRARY_PATH.
If you do not have Oracle Database on this computer, then install the Instant Client Basic or Basic Light package from 
https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html

解决步骤(注意使用管理员身份,否则可能有权限问题)
一、创建在opt下创建oracle文件夹

mkdir -p /opt/oracle

在这里插入图片描述

二、在oracle文件夹中安装oracle client,然后解压

cd /opt/oracle
wget https://download.oracle.com/otn_software/linux/instantclient/instantclient-basic-linuxx64.zip
unzip instantclient-basic-linuxx64.zip

在这里插入图片描述
三、ld配置

ldconfig
ldd /opt/oracle/instantclient_21_6/libclntsh.so

在这里插入图片描述
发现ldd之后出现了几个包没有找到的情况

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值