一、下载与安装
下载地址(tar.gz):/downloads/connector/odbc/
安装: #tar -zxvf mysql-connector-odbc-5.1.13-linux-glibc2.5-x86-64bit.tar.gz
#mv mysql-connector-odbc-5.1.13-linux-glibc2.5-x86-64bit mysql-connector-odbc
#cd mysql-connector-odbc/lib
#cp /root/odb/mysql-connector-odbc/lib/libmyodbc5.so /usr/lib/
#cp /root/odb/mysql-connector-odbc/lib/libmyodbc5.so /usr/lib64/
#cd /root/odb/mysql-connector-odbc/bin
#./myodbc-installer -d -a -n "MySQL ODBC 5.1 Driver" -t "DRIVER=/usr/lib/libmyodbc5.so;SETUP=/usr/lib/libmyodbc5.so"
二、配置
假设unixodbc安装在/root/odb/uodbc下。
#vi /root/odb/uodbc/etc/odbc.ini
增加mysql的配置信息:
-------------------------------------
[mysql]
Driver = MySQL
Description = mysql
SERVER = 192.168.1.111
PORT = 3306
USER = test
Password = test
Database = test
OPTION = 3
Threading = 1
ClientCharSet = UTF8
-------------------------------------
三、常见的问题 可能会出现的问题:
./myodbc-installer: error while loading shared libraries: libodbc.so.1: cannot open shared object file: No such file or directory
./myodbc-installer: error while loading shared libraries: libodbcinst.so.1: cannot open shared object file: No such file or directory
出现如上问题的解决办法:
参考:http://unixodbc.13851./unixODBC-manager-and-MySQL-connector-td350.html
#ln -s /usr/lib64/libodbc.so.2.0.0 /usr/lib64/libodbc.so.1
#ln -s /usr/lib64/libodbcinst.so.2.0.0 /usr/lib64/libodbcinst.so.1
四、验证安装
进入mysql即表示安装成功。
#isql mysql test test
如果觉得《linux mysql odbc驱动安装_mysql odb驱动_Mysql的odbc driver安装配置(Linux)》对你有帮助,请点赞、收藏,并留下你的观点哦!