Install and configure odbc in Linux and develop wxODBC

Source: Internet
Author: User
There are two ODBC types in linux: unixODBC and iodbc. Because wxGTK supports iodbc, you must install iodbc before installing wxGTK. After

There are two ODBC types in linux: unixODBC and iodbc. Because wxGTK supports iodbc, you must install iodbc before installing wxGTK. After

Install

There are two ODBC types in linux: unixODBC and iodbc. Because wxGTK supports iodbc, you must install iodbc before installing wxGTK. When freetds is installed later, unixODBC may also be installed based on the environment and dependency. The ODBC configuration files modified by iodbc and unixODBC are both/etc/odbc. ini and/etc/odbcinst. ini, these two are ODBC driver managers, there is no conflict, but if you want to use wxODBC for ODBC development, iodbc must be installed.

Install iodbc

If the yum source contains libiodbc, you can directly use yum install libiodbc * or search for the iodbc package in yumex for installation. Otherwise, you need to download the relevant rpm package online for installation.

Download libiodbc-3.52.6-1.i386.rpm

Download libiodbc-devel-3.52.6-1.i386.rpm

Download libiodbc-admin-3.52.6-1.i386.rpm

Download libiodbc-3.52.6-1.src.rpm

Rpm-ivh libiodbc-3.52.6-1.i386.rpm

Rpm-ivh libiodbc-devel-3.52.6-1.i386.rpm

Rpm-ivh libiodbc-admin-3.52.6-1.i386.rpm

Rpm-ivh libiodbc-3.52.6-1.src.rpm

Install wxGTK

./Configure -- with-odbc -- enable-monolithic -- enable-xrc -- enable-unicode

Make

Make install

Install codeblocks

Cp/usr/local/share/aclocal/wxwin. m4/usr/share/aclocal/wxwine. m4

./Bootstrap (aclocal may be required)

./Configure -- with-contrib-plugins = all

Make

Makeinstall

Connect to SQL Server

Install freetds

Yum install freetds *

(Or after yum yumex is installed, run yumex to search for freetds in all packages. Three packages are installed, and the other two are the develop and doc packages)

Configure ODBC driver

/Usr/bin/iodbcadm-gtk

ADD a driver to the ODBC Drivers midpoint

Enter the description of the driver to connect to the database, such as MSSQL or SQL server.

Enter/usr/lib/libtdsodbc. so in the driver file name. (The specific path may vary depending on the version. You can search libtdsodbc. so to find the specific path)

Enter/usr/lib/libtds. so in Setup file name (the specific path may be different)

Click OK to save ODBC driver settings

Configure DSN

Switch iodbcadm-gtk to system DSN

Click Add. In the displayed window, select the configured driver to be used and click OK.

Enter the Name of the new DSN Source in Data Source Name (DSN ).

Create the following Keyword and enter the value

Keyword Value

Databases Used

Port Number (SQL Server is 1433)

Server (IP address available)

TDS_Version 8.0

Trace No

Click OK to save DSN

Click Test to Test the data source. In the pop-up window, enter the user name and password, and click OK to view the Test results.

Click OK to exit iodbcadm-gtk

Available

Isql-v DSN name Username Password

Connection DSN

MySQL

Install driver

Use yumex to check whether the mysql-connector-odbc package is installed. If not, use yum install mysql-connector-odbc for installation.

Configure ODBC driver

Switch to ODBC Drivers in iodbcadm-gtk and click ADD a driver.

Enter the description of the driver to connect to the database, for example, MySQL.

Enter/usr/lib/libmydbc3.so in the driver file name (the name may vary depending on the mysql driver version, if it may be libmyodbc. so)

Enter/usr/lib/libodbcmyS. so in Setup file name. The specific paths may vary)

Click OK to save ODBC driver settings

Configure DSN

Switch iodbcadm-gtk to system DSN

Click Add. In the displayed window, select the configured driver to be used and click OK.

Enter the Name of the new DSN Source in Data Source Name (DSN ).

Create the following Keyword and enter the value

Keyword Value

Databases Used

Server (IP address available)

User Username

Password

Click OK to save DSN

Click Test or use

Isql-v DSN name Username 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.