Centos 安裝 ODBC
最后更新于:2022-04-02 03:55:26
[TOC]
> [参考](https://www.cnblogs.com/pycode/p/9495793.html)
## 实例:安装 mysql
### 安装依赖
```
yum install -y unixODBC unixODBC-devel libiodbc libiodbc-devel
```
### 安装 mysql-odbc
```
yum install -y mysql-connector-odbc
```
### 配置 odbcinst.ini
vim /etc/odbcinst.ini
```
[MySQL]
Description = ODBC for MySQL
Driver = /usr/lib/libmyodbc5.so
Setup = /usr/lib/libodbcmyS.so
Driver64 = /usr/lib64/libmyodbc5.so
Setup64 = /usr/lib64/libodbcmyS.so
FileUsage = 1
```
### 配置 odbc.ini
配置 odnc.ini 一般用户测试 odbcinst.ini 是否配置成功
vim /etc/odbc.ini
```
[ldap]
Driver = MySQL
Description = The Database for mysql
Database = ldap
Server = 10.10.211.6
User = ldap
Password = ldap123
Port = 3306
Socket = /var/lib/mysql/mysql.sock
ReadOnly = no
charset = UTF8
```
## 测试ODBC配置是否成功
```
isql -v ldap
```
';