For Ubuntu, you can also create ODBC connections based on an open-source project called iodbc, which aims to enable the UNIX System to Use ODBC connections. iodbc is the open-source implementation of ODBC. Tested on Ubuntu
8.04 and Ubuntu 8.10 can work normally.
First, you must have mysql. If it has not been installed, run the following command:
$ Sudo apt-Get install mysql-client mysql-Server
Install iodbc driver Manager (Front-End Interface written by GTK ):
$ Sudo apt-Get install iodbc
Install MySQL odcb connector:
$ Sudo apt-Get install libmyodbc
Start iodbc:
$ Sudo iodbcadm-GTK
You should be familiar with this interface. It is almost the same as the ODBC connection setting interface in windows. To connect to MySQL through ODBC, load the ODBC driver of MySQL, click the "ODBC drivers" tab card, and then click the "add a driver" button, in the "ODBC driver Add/setup" dialog box, set the following content in sequence:
Description of the driver: MySQL (you can name it at will)
Driver file name:/usr/lib/ODBC/libmyodbc. So
Setup File Name:/usr/lib/ODBC/libodbcmys. So
As shown in:
After setting, click "OK" to load the ODBC driver of MySQL. Then, you can create an ODBC connection for MySQL, click the "user DSN" or "system DSN" tab and click the "add" button to create an odcb connection. In the "choose an ODBC driver" dialog box, you can see the ODBC driver of the newly added MySQL instance, click the "finish" button to bring up the "setup of DSN unknown" dialog box. You need to set "data source name" (DSN) and some parameters. The data source name is usually defined by the user (for example, "mysqldb"). For MySQL standards, you must set the following parameters:
Server
Database
User
Password
Set the connection parameters, as shown in:
For more parameter details, refer to the official MySQL connection parameter information. Click OK and then click test. In the dialog box that appears, enter the MySQL user name and password and return "the connection DSN wastested successfully, and can be used at this time "is set successfully.
Now you can use various languages in Ubuntu to connect to MySQL through odcb.
Link: http://linux.chinaitlab.com/admi...