centos7 odbc mysql
1、yum install unixODBC unixODBC-devel libtool-ltdl libtool-ltdl-devel
2、yum install mysql-connector-odbc
vim /etc/odbc.ini
[test]
Driver=MySQL
SERVER=192.168.106.252
PORT=3306
DATABASE=svs2 #数据库名称
USER=root
PASSWORD=123456
Socket=/var/lib/mysql/mysql.sock
#isql test #连接数据库
#odbcinst -j #显示安装的信息
unixODBC 2.3.1
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
系统环境:
Linux localhost.localdomain 3.10.0-514.el7.x86_64 #1 SMP Tue Nov 22 16:42:41 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
亲测可以使用
生活不是马拉松,是冲刺,慢跑不断切换