MySQL ODBC for Linux

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.