Home » Programming » Connecting your code to a MySQL database using ODBC

Connecting your code to a MySQL database using ODBC

For people who want to set up a database on their computer in a windows environment you have come to the right place.

The tools we need and what they are for:

MySQL database  -  This is the database for storing all of your data
GUI Tools – This allows you to view the status and information within your database.
MySQL ODBC Driver – This allows your code to communicate with MySQL database. The code you send is translated in a way that MySQL database can understand. Choose the driver for the language you are going to use.  For the C++ code I use the regular ODBC driver and wxwidgets library for ODBC database to connect which was pretty easy after reading the tutorial.

1. First download the MySQL database, GUI Tools and the MySQL ODBC driver from http://dev.mysql.com/downloads/.
2. Install the MySQL database first and remember your root password with standard settings
3. Next, install the GUI Tools so you will be able to view and manually modify your database with ease.
4. Next, install the MySQL ODBC driver, after that you need to add the ODBC to your list.
5. For Windows XP go to control panel -> administrative tools -> odbc
6. For Windows Vista go to control panel -> odbc


7.Under User DSN click add.. and go to the MySQL driver you have installed and click ok.
8. Next check to see if you have connection properly
9. Use a program to test the connection between your code and MySQL database.
10. Now test it out by connecting your code to the database and you will be done. Depending on the language you use, they usually have a basic tutorial to allow you connect to the database.

Bookmark and Share

Popularity: 7% [?]

Random Posts

Tags: ,

Leave a Reply

Copyright © 2010 · Comp Sci Solutions · All Rights Reserved · Posts · Comments