Reference from http://blog.csdn.net/allens_zhou/article/details/8575400
Centos7 64bit
Yum Install UnixODBC unixodbc-devel MYSQL-CONNECTOR-ODBC
Vim/etc/odbcinst.ini
# Example Driver definitions# driver from the PostgreSQL-ODBC package# Setup from the UnixODBC package[postgresql]description= ODBC forPostgresqldriver=/usr/lib/Psqlodbcw.sosetup=/usr/lib/libodbcpsqls.sodriver64=/usr/lib64/Psqlodbcw.sosetup64=/usr/lib64/Libodbcpsqls.sofileusage=1# Driver from the MySQL-connector-ODBC package# Setup from the UnixODBC package[mysql]description= ODBC forMysqldriver=/usr/lib/Libmyodbc5.sosetup=/usr/lib/libodbcmys.sodriver64=/usr/lib64/Libmyodbc5.sosetup64=/usr/lib64/Libodbcmys.sofileusage=1
Vim/etc/odbc.ini
[flow-connector]description ' MySQL ' Databasedriver = mysqldatabase = mysqlserver = localhostusername = Rootpassword = passwordport 3306Socket =/var/lib/mysql/mysql.sock
Verify the MySQL driver, return the configuration section title in/etc/odbcinst.ini to indicate success, such as: [MySQL]
Odbcinst-q-D
Now you can connect to your database with isql function verification, and when you enter a command you will see a return value of 1 indicating that the connection was successful.
Echo " Select 1 " | Isql-v Asterisk-connector
MySQL ODBC for Linux