linux安装unixODBC
https://blog.csdn.net/u010587433/article/details/46799037 linux下mysql odbc配置
https://lonesysadmin.net/2013/02/22/error-while-loading-shared-libraries-cannot-open-shared-object-file/ 解决方案:Error While Loading Shared Libraries, Cannot Open Shared Object File
下载
从 http://www.unixodbc.org/ 下载:unixODBC-2.3.7.tar.gz
创建文件夹
创建unixODBC
文件夹, 把unixODBC-2.3.7.tar.gz
放到之内
cd 到 unixODBC文件夹
解压安装包
解压+进入解压后的文件夹1
2tar zxvf unixODBC-2.3.0.tar.gz
cd unixODBC-2.3.0
安装(要有root权限)
1 | su |
检测是否装好
(a) 检查ini文件
(目前ini文件是个空文件; mysql Connector安装后会在此ini文件内有设置)
1 | ll /ect/*.ini |
(b)检查library
(都放在/usr/local/lib/
: 可能user调用程序时,只能看到/usr/lib/
,看不到here)
1 | ll /usr/local/lib/ |
(c)检查程序bin1
2
3
4
5
6
7
8
9ll -rt /usr/bin
结果:
lrwxrwxrwx 1 root root 24 Feb 25 17:05 code -> /usr/share/code/bin/code*
-rwxr-xr-x 1 root root 93952 Feb 25 22:06 isql*
-rwxr-xr-x 1 root root 165376 Feb 25 22:06 dltest*
-rwxr-xr-x 1 root root 112680 Feb 25 22:06 odbcinst*
-rwxr-xr-x 1 root root 77000 Feb 25 22:06 iusql*
-rwxr-xr-x 1 root root 22856 Feb 25 22:06 odbc_config*
-rwxr-xr-x 1 root root 21056 Feb 25 22:06 slencheck*
(d)查看安装信息1
2
3odbcinst -j
结果1st:
odbcinst: error while loading shared libraries: libodbcinst.so.2: cannot open shared object file: No such file or directory
分析:
可能是运行odbcinst程序时,load library只看到了/usr/lib
;
忽视了放在/usr/local/lib
的libodbcinst.so.2
解决方案:
在/usr/lib
内创建链接link of 放在/usr/local/lib
的libodbcinst.so.2
操作:1
2
3
4
5
6
7
8
9
10
11
12ln -s /usr/local/lib/libodbcinst.so.2 /usr/lib/libodbcinst.so.2
ldconfig
odbcinst -j
结果2rd:
unixODBC 2.3.7
DRIVERS............: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini
FILE DATA SOURCES..: /etc/ODBCDataSources
USER DATA SOURCES..: /root/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8