How MySQL configures an ODBC data source

Source: Internet
Author: User
Tags dsn

ODBC data Source configuration: needs to be configured on the server where the site is located, the ODBC driver version number 5.15 is recommended. (explained in Mysql-connector-odbc-3.51.20-win32.exe)

An ODBC-based application operates on a database that does not rely on any DBMS, does not interact directly with the DBMS, and that all database operations are done by the corresponding DBMS's ODBC driver. So it is also important to configure the ODBC data source for MySQL.

    • Configure the appropriate environment beforehand (only the remote connection mode, MySQL configuration problem to find another method)
    • MySQL (MySQL setup program)
    • Mysql-connector-odbc-3.51.20-win32.exe (MySQL data source DOBC installer)

1. Download an ODBC driver for the MySQL database on the Internet: Mysql-connector-odbc-3.51.20-win32.exe (5.15 version recommended), install the file with the default option.

Open Data Source: Start-up settings, Control Panel, find data source

Open the data source (ODBC) and click the "Add" button on the User DSN tab to bring up the "Create New Data Source" window.

Select "MYSQL ODBC 5.1 Driver" and click "Finish" button.

A new window pops up to fill in the data source information in the Login tab.
The original name of the data source name;
Discription description (optional);
The IP of the Server data source computer;
User database username;
Password database password;
Database data source to connect to;

After the configuration, click the "Test" button, if the following prompt, that is, the configuration is successful.

Click "OK" to return to the User DSN tab and add a record with the name of the data source you configured.

When connecting, be sure to have a corresponding database (table), if no connection failure is indicated.

Database Connection File

<%
' Test reads the contents of the MySQL database

strconnection= "Driver={mysql ODBC 5.1 driver};d atabase= database name; server= server IP address; uid= user name; password= password"
' No DSN configuration required
Set adodataconn = Server.CreateObject ("Adodb.connection")
Adodataconn.open strconnection

strquery = "SELECT * FROM table name"
Set rs = Adodataconn.execute (strquery)
If not Rs.bof then
%>
<%
Do and not rs.eof
%>

How MySQL configures an ODBC data source

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.