今天发现在服务器上的后端代码连接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之后出现了几个包没有找到的情况