How to set up DSN in ODBC Data Source Administrator on Windows
Open Database Connectivity (ODBC) is a widely used programming interface that enables applications to access data in
Database Management Systems (DBMS) that use Structured Query Language (SQL) as a data access standard.
You can use ODBC Data Sources to access data stored in a variety of DBMS such as MS SQL Server, Oracle, MySQL, and many others.
To access data in a ODBC-compliant DBMS database, you must add software components called drivers to your
system. ODBC Data Source Administrator helps you add and configure these drivers.
This article shows you how to set up an ODBC Data Source Name (DSN) by using MySQL Connector/ODBC 3.51 (also known as MyODBC).
Setting up DSN for other DBMS systems has very similar steps.
The following two programs must be installed on your computer before you proceed.
Refer to the following two pages for MySQL installation guide.
How to install MySQL 4.1 on Windows
- MyODBC driver
MyODBC works on Windows 9x, Me, NT, 2000, XP, and 2003, and on most Unix platforms.
Download MySQL Connector/ODBC 3.51. Choose Windows MSI Installer (x86) to download on the page. The installation is pretty simple and should only take a few minutes at the most.
You can find detailed documentation about MyODBC on MySQL.com website.
Steps to set up MySQL ODBC DSN
Following the following steps to set up MySQL ODBC DSN (Data Source Name).
Open ODBC Data Source Administrator.
To open ODBC Administrator, click Start, point to Settings, and then click Control Panel. Double-click Administrative Tools,
and then double-click Data Sources (ODBC).
Click System DSN tab and click Add button (a System DSN is available to all users of the computer, including Services.
If you want to create a DSN that is only available to you, create User DSN).
An ODBC System data source stores information about how to connect to the indicated data provider. A System data source is visible to all users on this machine
In the Create New Data Source window, scroll down until you find MySQL ODBC 3.51 Driver. Select it and click Finish. If you can't see MySQL ODBC 3051 Driver in the list, you need to download and install MySQL Connector/ODBC 3.51 first.
Now fill in connection information about how to connect to a database in MySQL.
Data Source Name: A unique name here to identify this data source. It has nothing to do with any system names.
Just make up a name that you think is appropriate. Here we type in myodbc.
Description: A brief description about this data source.
Server: Host name or IP address of the MySQL server. The default is localhost.
User: The MySQL username used to connect to MySQL server. Normally you can username root. Make sure you have installed MySQL server. Refer to MySQL installation guide here.
Password: The password for the User. Type in the password of root user.
Database: The default database name used when connecting to MySQL server. Click the drop-down box and select the database you need
to connect to. Here we choose northwind. If you don't have northwind database in your MySQL server, you can run this command to create an empty northwind database:
CREATE DATABASE northwind
Note: If you don't use default MySQL port 3306
, you need to specify its Port number, and/or other info on Connect Options tab. See screenshot below. If you don't specify anything, the connection to localhost will be using default port 3306.
Click Test button to make sure the connection information you just entered is correct.
Click OK to create the DSN. Screenshot below shows that myodbc has been created. Click OK to close ODBC Administrator.
Other Recent Articles from the WAMP & LAMP category: