Mysql Dsn Driver For Mac

By Danny Kohn

Mysql Dsn Driver For Mac Windows 7

If you don't have MySQL drivers installed, follow the steps to install the Mac driver for MySQL. Important: There have been some cases where MySQL driver 8.0.x can't connect to MySQL 5.x database. Therefore, we strongly recommend you use the latest driver version that most closely matches the database version you need to connect to. I am having problems accessing my MySQL database from R on mac (Mac OS X 10.11.2). RODBC ERROR: state IM002, code 0, message unixODBC Driver ManagerData source.

Previous Versions of FileMaker Pro and ODBC

Filemaker Pro has had the ability to connect to and use ODBC as early as version 7. Using the Execute SQL script step, you could specify a ODBC DSN (Database Source Name) and execute any SQL statement that you can build with a FileMaker Pro calculation which could include field data.

Limitations of this functionality included the following:

  • Communication is only one way.
  • You must be well versed in SQL.
  • It must be done through a script.

In databases I had created in FileMaker Pro 7 where data synchronization with a MySQL database was required, I was forced to first delete all data in each MySQL table before repopulating it with live data from the FileMaker database.

FileMaker Pro 9 and ODBC

In FileMaker Pro 9, ODBC connections are treated like a FileMaker Pro external data source, formerly known as file references. The data source acts similar to a reference to another FileMaker Pro database file. Tables can be added to the relationship graph, layouts can be created showing records from a MySQL (or any ODBC capable database) table. Calculations can be made in the context of a data source table. You can even add calculation and summary fields to the tables for use within FileMaker Pro.

Through a layout, you can then add, remove or modify the external records as if they were in a FileMaker Pro table. No SQL required. No scripts required. Theoretically, you could create an entire FileMaker Pro database based solely on MySQL data tables with no tables defined within the FileMaker Pro file.

You can now use FileMaker Pro as a friendly front-end to any MySQL, MS SQL, Oracle, Access or any ODBC capable database. The only thing you can not do from within FileMaker Pro is create tables and fields.

What is ODBC?

ODBC, an acronym for Open Database Connectivity, is a standard protocol for communicating with databases. It allows users to set up a DSN, or Database Source Name, that can be used by any ODBC aware application on a particular computer to send queries and receive data from a specified data source. It is kind of like having a shortcut or alias on your desktop linking to a file on a server, except the shortcut is a DSN and instead of a file on a server, it links to a database.

Mysql Dsn Driver For Mac

By setting up a DSN, you are assigning an arbitrary name, or shortcut, that will be recognized by your computer as a pointer to a server and database. The scope of a DSN can be restricted to a particular computer user or to a computer system. A single DSN can not be used on multiple computers. If database connectivity is required on multiple computers, it is necessary to set up a DSN on each computer.

ODBC Setup Overview for FileMaker Pro 9

There are 4 basic steps for getting FileMaker Pro 9 to work with other databases.

  1. Install an ODBC Driver.
  2. Set up the DSN.
  3. Add the DSN data source to the FileMaker Pro database.
  4. Add the table(s) to the relationship graph.
Mysql Dsn Driver For Mac

Each of these steps is explained in detail below.

Installing the MySQL ODBC Driver for Mac OS X

There are a number of MySQL ODBC drivers available for Mac OS X, many of which have simple package installers. I have only managed to get one to work properly with FileMaker Pro: Actual ODBC Driver for Open Source Databases. It comes with a $30 price tag.

MySQL.com has a free, open-source driver available, but I could not get it to work properly for FileMaker due, apparently due to a bug in Mac OS X's iODBC driver manager. If you are interested in the details, I filed a bug report. Hopefully, they will have a work around soon.

Both drivers come with an easy to use, standard OS X package installer. Download, double click, click Next a few times, and you are done.

Setting Up the DSN

Once the driver is installed, you can create a DSN using the Mac OS X ODBC Administrator program located at Applications/Utilities/ODBC Administrator. FileMaker Pro 9 only supports system data sources and does not support user data sources. So, you must add a User DSN:

  • Select the User DSN tab.
  • Click the lock and authenticate to allow changes.
  • Click Add.
  • Choose the appropriate driver (probably 'Actual Open Source Databases').
  • Click Continue.
  • Enter a name for the data source. This can be whatever makes sense to you, but if two or more computers are being set up to use the same source, the names must be identical.
  • Click Continue and enter the MySQL database server address.
  • Enter MySQL database server login information and click continue.
  • Click the drop down arrow next to the Database field and select the database to which this DSN should link. If a list of databases on the MySQL server appears in this drop down, you know a successful connection was made.
  • Click Finish or Continue if you wish to review the settings and test the connection.
Using the Data Source in FileMaker

In the FileMaker Pro database, perform the following steps:

  • Open the Manage External Data Sources window through the File->Manage->External Data Sources... menu item.
  • Click New..., to add a data source.
  • Enter a name, choose ODBC, then click the Specify... button.
  • Choose the DSN data source you recently created and click OK.
  • If you wish, enter a user name and password for the MySQL server, or you may leave it set to require entry by users. Since you can use calculations to specify user credentials, you can easily customize the authentication process, including passing the user's FileMaker Pro database user name and password to the MySQL server. Keeping users synchronized between databases is a topic worthy of its own article.
Add a Table to the Relationship Graph

The rest of the process is quite simple. When you go to the relationship graph and click the Add Table button, you will see your new data source in the Data Sources drop down menu. Select it and add the desired table as you would with any FileMaker Database. You can then include it in any relationships, create new layouts with it and add Calculation and Summary fields under the Fields tab.

Danny Kohn is a Software Engineer and Consultant for Inspirations Software Design (ISD). ISD is an IT services and consulting firm specializing in custom business solutions with human interfaces that are easy to learn and simple to use.

For answers to your FileMaker Pro, MySQL or ODBC questions, help developing the database you need or integrating your FileMaker Pro database with your PHP web site or MySQL database, visit http://www.InspirationsSoftwareDesign.com

Article Source: http://EzineArticles.com/expert/Danny_Kohn/132312
http://EzineArticles.com/?Connecting-FileMaker-Pro-with-MySQL-in-Mac-OS-X&id=780323

Create odbc dsn

5.3.1 Configuring a Connector/ODBC DSN on Windows with the ODBC Data Source Administrator GUI

The ODBC Data Source Administrator on Windows lets you create DSNs, check driver installation, and configure ODBC functions such as tracing (used for debugging) and connection pooling. The following are steps for creating and configuring a DSN with the ODBC Data Source Administrator:

  1. Open the ODBC Data Source Administrator.

    Different editions and versions of Windows store the ODBC Data Source Administrator in different locations. For instructions on opening the ODBC Data Source Administrator, see the documentation for you Windows version; these instructions from Microsoft cover some popuar Windows platforms. You should see a window similar to the following when you open the ODBC Data Source Administrator:

    Figure 5.1 ODBC Data Source Administrator Dialog


  2. To create a System DSN (which will be available to all users), select the System DSN tab. To create a User DSN, which will be available only to the current user, click the button to open the 'Create New Data Source' dialog.

  3. From the 'Create New Data Source' dialog, select the MySQL ODBC 5.x ANSI or Unicode Driver, then click to open its connection parameters dialog.

    Figure 5.2 Create New Data Source Dialog: Choosing a MySQL ODBC Driver


  4. You now need to configure the specific fields for the DSN you are creating through the Connection Parameters dialog.

    Figure 5.3 Data Source Configuration Connection Parameters Dialog


    In the Data Source Name box, enter the name of the data source to access. It can be any valid name that you choose.

    To identify whether a DSN was created using the 32-bit or the 64-bit driver, include the driver being used within the DSN identifier. This will help you to identify the right DSN to use with applications such as Excel that are only compatible with the 32-bit driver. For example, you might add Using32bitCODBC to the DSN identifier for the 32-bit interface and Using64bitCODBC for those using the 64-bit Connector/ODBC driver.

  5. In the Description box, enter some text to help identify the connection.

  6. In the Server field, enter the name of the MySQL server host to access. By default, it is localhost.

  7. In the User field, enter the user name to use for this connection.

  8. In the Password field, enter the corresponding password for this connection.

  9. The Database pop-up should be automatically populated with the list of databases that the user has permissions to access.

  10. To communicate over a different TCP/IP port than the default (3306), change the value of the Port.

  11. Click to save the DSN.

Mysql Dsn Driver For Mac Os

To verify the connection using the parameters you have entered, click the button. If the connection can be made successfully, you will be notified with a Connection Successful dialog; otherwise, you will be notified with a Connection Failed dialog.

You can configure a number of options for a specific DSN by clicking the button.

Figure 5.4 Connector/ODBC Connect Options Dialog


Toggling the Details button opens (or closes) an additional tabbed display where you set additional options that include the following:

Mysql Dsn String

  • Connections, Metadata, and Cursors/Results enable you to select the additional flags for the DSN connection. For more information on these flags, see Section 5.2, “Connector/ODBC Connection Parameters”.

    For the Unicode version of Connector/ODBC, due to its native Unicode support, you do not need to specify the initial character set to be used with your connection. However, for the ANSI version, if you want to use a multibyte character set such as UTF-16 or UTF-32 initially, specify it in Character Set box; however, that is not necessary for using UTF-8 or UTF-8-MB4 initially, because they do not contain 0 bytes in any characters, and therefore the ANSI driver will not truncate the strings by accident when finding 0 bytes.

  • Debug lets you turn on ODBC debugging to record the queries you execute through the DSN to the myodbc.sql file. For more information, see Section 5.8, “Getting an ODBC Trace File”.

  • SSL configures the additional options required for using the Secure Sockets Layer (SSL) when communicating with MySQL server.

    Figure 5.5 Connector/ODBC Connect Options Dialog: SSL Options


    You must also enable and configure SSL on the MySQL server with suitable certificates to communicate using it using SSL.