Establish ODBC source in Linux-MySQL

Source: Internet
Author: User
Tags dsn
Databases are needed during my internship, but I use Linux. I can only install ODBC and MySQL below (Oracle is too big)

1. install necessary packages

Install ODBC
Sudo apt-Get install unixodbc

Install the ODBC graphical interface (if you want to create a new system DNS, use the Administrator mode sudo when running)
Sudo apt-Get install unixodbc-bin
Sudo odbcconfig

Install the ODBC driver of MySQL
Sudo apt-Get install libmyodbc

2. Create an ODBC Data Source

1) You can use the sudo odbcconfig GUI to create
2) Console mode

/Etc/odbcinst. INI is a database driver with ODBC
/Etc/ODBC. ini System DNS Configuration
~ /. ODBC. ini user DNS Configuration

Below is my configuration file

/Etc/odbcinst. ini

[MySQL]
Description = MySQL driver
Driver =/usr/lib/ODBC/libmyodbc. So
Setup =/usr/lib/ODBC/libodbcmys. So
Cptimeout =
Cpreuse =

/Etc/ODBC. ini

[ODBC data sources]
Myodbc = MySQL ODBC 2.50 driver DSN
Mydbc3 = MySQL ODBC 3.51 driver DSN

[Zhaobiao]
Description = MySQL ODBC 2.50 driver DSN
Driver = MySQL
Server = localhost
Database = zhaobiao
Port =
Socket =
Option = 3
Stmt =
User = root
Password =

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.