Home arrow MySQL arrow Page 3 - Using MyODBC to Connect to a Remote Database
MYSQL

Using MyODBC to Connect to a Remote Database


Using MySQL's support for MyODBC, you can connect to remote databases, import and export tables to and from your MySQL database and more. In this article Steve shows us exactly how to get started...

Author Info:
By: Steve Knoblock
Rating: 5 stars5 stars5 stars5 stars5 stars / 38
January 02, 2003
TABLE OF CONTENTS:
  1. · Using MyODBC to Connect to a Remote Database
  2. · Why Connect Using MyODBC?
  3. · Installing MyDOBC
  4. · MyODBC Setup
  5. · Exporting a Table to the Remote Database (contd.)
  6. · Conclusion

print this article
SEARCH DEVARTICLES

Using MyODBC to Connect to a Remote Database - Installing MyDOBC
(Page 3 of 6 )

Once you've download MyODBC into a convenient directory on your hard disk, you can open the archive and decompress the files inside. I suggest using WinZip or other application that makes the job of extracting files easy.

You can start WinZip by double-clicking on the file in the Windows Explorer. I keep mine set to the classic version, which makes the Install button readily available. This is a cool feature that will automatically create a temporary directory, unzip the archive, extract the files and start installation by running setup.exe if it finds one. Here's what the screen looks like just before installation.



Don't forget to tell WinZip that the installation is complete so it can close its window and clean up the files. When you start the installation process, the first window you see will be the Microsoft ODBC Setup dialog. Click Continue.



At this point, the Install Drivers dialog window should appear. (If you do not reach this point in the installation, something is wrong with the way Windows is setup. Please contact Microsoft support to help resolve this issue.) Select MyODBC and click OK (or just click OK).



If have trouble installing the driver or are merely curious, you will find version related installation options by clicking on the Advanced button. This button brings up the Advanced Installation Options dialog window.



Further information about the driver version is available in the Versions dialog, by clicking on the Versions button in the Advanced Installation Options dialog.



If the MyODBC driver was successfully installed, the next dialog you see will be the Data Sources dialog. This dialog is part of the Microsoft ODBC system and not a part of MyODBC. You should see the sample data source installed by MyODBC, called sample-MySQL (MySQL) in the data sources driver window. Although you could select the MySQL entry and push the Setup button to bring up the MyODBC setup panel, we will be configuring the remote connection from within MS Access. That is so we can create a data source tailored to our project.



When you're done, you should see a message telling you that the new ODBC driver has been successfully installed. Click OK.



Configuring and Connecting

Connecting to An Established Remote Database
Once you have installed the driver, we will use Access to connect to the remote database. The database must be setup for remote access. At many hosting providers, this is done only by request. Please ask your administrator or hosting provider support team about activating remote access to your MySQL database. Setting up a Data Source, choosing a ODBC driver and creating a Data Source Name (DSN) for Windows applications to reference your database can be a daunting task. There are many settings involved and many terms which you may be unfamiliar with. But broken down, the steps are relatively easy to follow and fall into place.

Click File | Get External Data | Import. Click New in the Data Source window. The MyODBC driver dialog should appear.

Creating a New Data Source
At this point you need to create a new data source. A data source is where data comes from through a ODBC connection. The Database Source Name (DSN) is the name of the database. When you create the database source, give it any name you like.

Using the Create a New Data Source Wizard
The first step is to create a new Windows data source. This allows Windows applications to connect to your ODBC database. Select User Data Source. Click Next.



The next screen presents you with a list of available ODBC drivers you can use to create a data source. (You can have as many data sources as you need, each using any ODBC driver available). Select the MySQL driver. It will be identified as to name, version and the developer, TCX. Click Next.



A purely informational screen appears, displaying the data source type and choice of ODBC driver. As the dialog says, the next step will be to optionally configure the driver-specific settings. Click Next.
blog comments powered by Disqus
MYSQL ARTICLES

- MySQL and BLOBs
- Two Lessons in ASP and MySQL
- Lord Of The Strings Part 2
- Lord Of The Strings Part 1
- Importing Data into MySQL with Navicat
- Building a Sustainable Web Site
- Creating An Online Photo Album with PHP and ...
- Creating An Online Photo Album with PHP and ...
- PhpED 3.2 More Features Than You Can Poke ...
- Creating An Online Photo Album with PHP and ...
- Creating An Online Photo Album with PHP and ...
- Security and Sessions in PHP
- Setup Your Personal Reminder System Using PHP
- Create a IP-Country Database Using PERL and ...
- Developing a Dynamic Document Search in PHP ...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials