1.安装unixodbc
apt-get install unixodbc
2.安装mysql odbc驱动
apt-get install libmyodbc
3.配置mysql odbc驱动
编辑/etc/odbcinst.ini
[MySQL]
Description = odbc driver for MySQL
#Driver = /usr/lib/odbc/libmyodbc.so
#Setup = /usr/lib/odbc/libodbcmyS.so
Driver64 = /usr/lib/x86_64-linux-gnu/odbc/libmyodbc.so
Setup64 = /usr/lib/x86_64-linux-gnu/odbc/libodbcmyS.so
FileUsage = 1
4.添加DSN
编辑/etc/odbc.ini
[my_dsn]
Description = emma database on devel2
Trace = On
TraceFile = stderr
Driver = MySQL
Server = 10.3.15.40
PORT = 3306
DATABASE = mydatabase
User = root
Password = mypassword
OPTION = 67108864
5.测试连接
isql my_dsn
Ubuntu下为PostgreSQL添加ODBC驱动过程:http://www.linuxdiyf.com/linux/6072.html
腾讯云CentOS7.0使用yum安装mysql:http://www.linuxdiyf.com/linux/16624.html
CentOS 7.1上编译安装MySQL 5.7.10:http://www.linuxdiyf.com/linux/16538.html
Ubuntu14.04编译安装mysql5.6.26:http://www.linuxdiyf.com/linux/14453.html
Ubuntu安装mysql和简单操作:http://www.linuxdiyf.com/linux/14327.html