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...
Using MyODBC to Connect to a Remote Database - Why Connect Using MyODBC? (Page 2 of 6 )
With MyODBC you can:
Connect to a remote database server from anywhere you have access to a desktop application, such as Microsoft Access.
Export a database to the remote server.
Import a database from the remote server.
Link a local database to a remote database.
Exporting. It's useful to export a database when you are first populating a remote or online database. If you have an existing database that you want to put online, exporting it from Access to MySQL through an ODBC connection greatly simplifies the process. It allows even novices to get their database to the online server without requiring any knowledge of Unix shell commands or utility applications. It's important to note that exporting is a static process transferring a table from the local to the remote server once each time. There is usually no feedback beyond a progress indicator. When you export a table, SQL statements are sent to the remote SQL server to create the table (CREATE TABLE) and to insert the data being transferred (INSERT). If the table has already been created, a CREATE TABLE statement is not issued and the new information is transferred using (UPDATE).
Importing. Importing a table from a remote database can be very useful when you want to create a report from information stored in an online database server. By importing a table into Access, you can generate charts or reports from data gathered online easily. It's important to note that importing is also a static process transferring a table from the remote to the local server once each time. There is usually no feedback beyond a progress indicator.
Linking. When you link a local table to a remote table, you allow desktop users to make changes to the remote table through the graphical user interface of Access. For example, if a table row is added or modified through an Access form attached to a particular table linked to the remote table, the remote table will be updated to include the changes. This can help novices to maintain online database information in an easy to use and familiar environment. One of the benefits of linking tables is that any changes made by the user to the local database are also made to the remote database. This makes the whole processing of coordinate remote and local databases more visible.
All these tasks can be accomplished through use of the MySQL command line monitor from the Unix shell, but only for the initiated. Sometimes experts may be more comfortable working from the command line, issuing SQL queries to affect the remote database but for many people (clients, office workers) ODBC is the easy way to get their data to the remote server or produce nicely formatted charts and reports from online data. MyODBC is an important item in the developer's toolkit. It allows you to offer clients an easy and flexible interface to their online database through an application and platform they are familiar with. For the web applications developer, allowing users to update their online database from the desktop can be a time-saver. Data entry and database management may be accomplished from the desktop, while a PHP script generates pages dynamically based on the content stored in database tables.
Microsoft Access is not available for the Macintosh. However, it is possible to exchange or share data in the following ways:
You may save the Access data from tables, queries, and all or selected portions of datasheets to file formats that can be opened by Office 98 for the Macintosh applications.
Share data from a network server using Microsoft FoxPro for Macintosh users and Microsoft Access for PC users.
Share data using ODBC drivers.
Getting Started With MyODBC
Downloading MyODBC The MyODBC download package is available at the MySQL site http://www.mysql.com/ in the Downloads section. Scroll down to the MySQL Related Software and choose Downloads for MyODBC.
For a faster download, try one of the MySQL mirror sites. Choose the mirror that is closest to you.
MyODBC is available for the Windows 9x and NT platforms as well as various flavors of Unix (including Linux). The source code for MyODBC is included in the distribution. If you only want to use the MyODBC application, you can safely ignore the various makefiles and C code included with it in the download package. Just install the MyODBC executable program (it's easy, see below).
MyODBC is distributed in separate versions for Windows 9x and NT because of a bug in Microsoft ODBC setup that prevents it from detecting the operating system. The current version of MyODBC is 2.5. The latest version of the MyODBC download package for Windows 9x myodbc-2.50.28-win95.zip is available. Make sure you are using the latest version containing all the updates and fixes. MyODBC archive is about 1.5K and downloads in a few mintues at 56k.