Exchanging Data Between MySQL and FileMaker Pro

Problem

You want to exchange information between MySQL and FileMaker Pro.

Solution

Under Windows, you can make an ODBC connection from FileMaker Pro to the MySQL server. Alternatively, you can export tables into files from MySQL and import them into FileMaker Pro, or vice versa. But watch out for conversion issues like incompatible date column types.

Discussion

If you can connect from FileMaker Pro to your MySQL server over an ODBC connection, you can access MySQL tables that way. The procedure is similar to that for connecting to MySQL from Access. (See Recipe 10.39.)

Another option is to export data from one program into files and then import them into the other program. The transfer directory of the recipes distribution contains a mysql_to_filemaker.pl utility that exports a MySQL table to a file that you can import into FileMaker Pro. This script is designed to handle the following FileMaker Pro-specific issues:

  • FileMaker Pro’s default date format is MM-DD-CCYY. The script rewrites the contents of any columns in the MySQL table that contain dates so that they match FileMaker Pro’s date format.

  • FileMaker Pro has date and time column types, but not a combined date-and-time type. mysql_to_filemaker.pl exports DATETIME and TIMESTAMP columns as separate DATE and TIME values. (For example, a table column named c is exported as two columns named c_date and c_time.)

  • Any internal carriage returns or linefeeds in column values are mapped to ...

Get MySQL Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.