What is ODBC ?
ODBC stands for Open Data Base Connectivity. It is a connection that is created to define a connection between a computer and a database stored on another system. The ODBC connection contains information needed to allow a computer user to access the information stored in a database that is not local to that computer. You need to define the type of the database application – like Microsoft SQL or Oracle or FoxPro or mySQL. Once you have defined the type of database you need to select or supply the appropriate driver for a connection (Windows already contains many of these) and then supply the name of the database file and the credentials needed to access the database.
Once the ODBC connection is created, you can tell specific programs to use that ODBC connection to access information in that database.
How To Setup an ODBC Connection To MySQL Database
This tutorial has been performed on a Windows XP SP3 workstation. These steps might differ on a different operating system.
First of all you will the MySQL Connector/ODBC. At the time of this writing, the lastest version is 5.1.4. You can get it here. Personnally I’d recommend you to get the MSI version of the connector. Once downloaded, simply launch it, choose the “Typical” setup and go through the installation.
Before we try to create an ODBC connection, we need to make sure that our workstation’s IP address (or hostname) has the right to access the MySQL server remotely. Please check the steps mentioned at Remote Mysql Access to allow the IP.
Now back to our MS Windows desktop, let’s create our ODBC connection. Click on Start => Settings => Control Panel => Administrative Tools and double-click the Data Sources (ODBC) icon.
If its not showing then you might have advance vie for control panel.Please switch back using ‘Switch to Classic View’
At this point, you have the choice of creating an ODBC connection that will be available only to the current logged on user (User DNS) or for all the user profiles on this workstation (System DSN). Unless there are some security risks, I always make the ODBC connections available to all.
Select the System DSN tab and click on the Add button. You will asked to select which ODBC driver to use. Select MySQL ODBC 5.1 Driver from the list and hit Finish.
You will now need to enter the configuration information for this ODBC connection:
- The Datasource Name is the name of the ODBC connection you will refer to within your 3rd party applications when using this connection.
- The Description field is optional. You may enter any other information you might find useful.
- The TCP/IP server contains the hostname (FQDN) or IP address of your MySQL server. If you’re unsure about this pelase send us a mail at firstname.lastname@example.org.
- The default port is 3306, so you can leave it as it is.
- Enter the username you’ve created for this database as well as its password.
If you’ve entered all the information correctly, you will see a list of available databases from the Database dropdown menu. Select the appropriate database from the list and click on OK. I’ve blurred out some fields for security reasons
Its done now.