Custom Search
 


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.

A practical example of how to use MySQL DSN created here can be found in How to export Northwind Access database to MySQL.

Pre-requisites

The following two programs must be installed on your computer before you proceed.

  1. MySQL server

    Refer to the following two pages for MySQL installation guide.

    How to install MySQL 4.1 on Windows

  2. 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).

  1. 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).

  2. 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

    ODBC Administrator.

  3. 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.

    Select MySQL ODBC driver.

  4. 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

    Enter MySQL ODBC connection information.


    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.

    Enter MySQL ODBC connection port information.



  5. Click Test button to make sure the connection information you just entered is correct.

    Test MySQL ODBC connection.

  6. Click OK to create the DSN. Screenshot below shows that myodbc has been created. Click OK to close ODBC Administrator.

    MySQL ODBC successfully created.




Copyright© GeeksEngine.com



Related Articles:

1.Connect to a MySQL Database from PHP version 5 or later versions
2.How to Connect to a MySQL Database from PHP (version lower than PHP 5.0.0)


Other Recent Articles from the WAMP & LAMP category:

1.How to install MySQL Server 8 on Windows
2.How to resolve Apache web server port 80 access problem
3.The free tools I use to build PHP and MySQL websites
4.Steps to install PHP 5.x on Windows as a development machine
5.How to install Apache 2.x web server on Windows
6.How to connect two different versions of MySQL server on the same computer
7.How to configure MySQL server 5.1 on Windows
8.How to install MySQL server 5.1 on Windows with screenshots
9.How to upgrade from PHP4 to PHP5
10.How to load time zone data for MySQL on Windows
11.How to use Apache Virtual Host to run multiple local websites on Windows
12.Install all PEAR packages by yourself
13.How to install PEAR on Windows
14.How to use PHP and Microsoft SMTP Virtual Server to send emails
15.How to install PHP server-side scripting language on Windows
16.How to install Apache 1.3 web server on Windows
17.How to install two different versions of MySQL server on the same PC
18.How to configure MySQL server 4.1 on Windows
19.How to install MySQL server 4.1 on Windows with screenshots

Copyright © 2024 GeeksEngine.com. All Rights Reserved.

This website is hosted by HostGator.

No portion may be reproduced without my written permission. Software and hardware names mentioned on this site are registered trademarks of their respective companies. Should any right be infringed, it is totally unintentional. Drop me an email and I will promptly and gladly rectify it.

 
Home | Feedback | Terms of Use | Privacy Policy