How To Install and Configure the Lite Edition ODBC Drivers for MySQL (macOS)

Pre-Installation Guide

  1. You need to know a variety of information pertaining to your MySQL Server:
    • MySQL TCP port: The port number on which the MySQL Server is listening.
    • Hostname or IP address of the MySQL database server: The hostname or IP address of the server where the MySQL database server is running.

Installation Guide

  1. Download and open the Lite Edition (Single-Tier) ODBC Driver for MySQL Data Sources, which is distributed in a single disk image (.dmg) file, containing a Macintosh Installer package (.mpkg).
    • Double-click the .mpkg to start the installation process.
  2. After the driver has been installed, you will be prompted to locate a license file.
    • NOTE - If a correctly named file already exists in $OPL_LICENSE_DIR, /Library/Application Support/OpenLink/Licenses/, you will not see this dialog. If the existing file is not valid (evaluation has expired, it's for a different OS, it permits insufficient processor cores, etc.), you will need to manually apply a valid license file after installation is completed.
    • NOTE - In some environments, this dialog may be hidden by the Installer.app or other windows on your Mac. Please minimize, hide, and/or move windows until you can see and act on this dialog. If you do not answer this dialog, the installation will not complete properly, and the driver will not function as desired.
    • If a license file already exists on the machine, select the 'use existing' option. (Previously generated license files may be re-downloaded from your ODS-Briefcase data space.)
    • If you need to obtain a new trial or permanent license file, select the 'try or buy' option, which will load a relevant web page from which you can obtain a license file.

Configuration Guide

  1. To configure an ODBC DSN, run the OpenLink iODBC Administrator located in the /Applications/iODBC folder.
    • Click the System DSN tab.
    • Click the Add button.
  2. Select the OpenLink MySQL Lite Driver from the list of available drivers. Select the Unicode version of the driver if and only if you are working with multi-byte character sets, as unnecessary translations can significantly affect ODBC performance.
    • Click Finish.
  3. The Data Source tab prompts for information that identifies the MySQL database server and listen port. It also requests a name for your Data Source. You may also supply an optional description for your Data Source Name.
    • DSN: A brief and meaningful title for your Data Source Name.
    • Description: An optional description for your Data Source Name.
    • Host: The hostname or IP of the server on which MySQL runs.
    • Port: The TCP port on which MySQL listens.
    • Click "Continue" to proceed to the next step.
  4. The Connection Tab takes a combination of required and optional parameters to make a connection to the target database.
    • Username: A MySQL username.
    • Choose a database with this data source: Check to override the default database associated with the DBMS.
    • Password: A valid MySQL password.
    • Database: A valid MySQL database. Note: A valid username and password must be input above before this menu can be used.
    • Click Continue to view options that can be set for the connection:
  5. Additional connection options:
    • Row Buffer Size: This attribute specifies the number of records to be transported over the network in a single network hop. Values can range from 1 to 99.
    • Hide Login Dialog: Suppresses the ODBC "Username" and "Password" login dialog boxes when interacting with your ODBC DSN from within an ODBC compliant application.
    • Read Only connection: Specifies whether the connection is "Read-only." Make sure the checkbox is unchecked to request a "Read/Write" connection.
    • No transactions: Disable ODBC transaction management. All transactions will be automatically committed. This prevents palloc() failures with out-of-memory errors when doing really big transactions such as exporting 10000 records from MS/Access.
    • Reconnect on Cancel:
    • Prepare Method: This option can take the values None, Partial, Full (connectoptions -O [0, 1, 2] respectively). It is used to determine whether stored procedures are created on the server for calls to SQLPrepare.
    • Character set:
    • SQL_DBMS Name: Manually overrides the SQLGetInfo(SQL_DBMS_NAME) response returned by the driver. This is required for products like Microsoft InfoPath for which the value should be "SQL Server."
    • Click Continue to view additional preferences that can be set for the connection:
  6. Additional preferences:
    • Initialization SQL: Lets you specify a file containing SQL statements that will be run automatically against the database upon connection.
    • Cursor Sensitivity: Enables or disables the row version cache used with dynamic cursors. When dynamic cursor sensitivity is set high, the Cursor Library calculates checksums for each row in the current rowset and compares these with the checksums (if any) already stored in the row version cache for the same rows when fetched previously. If the checksums differ for a row, the row has been updated since it was last fetched and the row status flag is set to SQL_ROW_UPDATED. The row version cache is then updated with the latest checksums for the rowset. From the user's point of view, the only visible difference between the two sensitivity settings is that a row status flag can never be set to SQL_ROW_UPDATED when the cursor sensitivity is low. (The row status is instead displayed as SQL_ROW_SUCCESS.) In all other respects, performance aside, the two settings are the same. Deleted rows don't appear in the rowset. Updates to the row since the row was last fetched are reflected in the row data, and inserted rows appear in the rowset if their keys fall within the span of the rowset. If your application does not need to detect the row status SQL_ROW_UPDATED, you should leave the 'High Cursor Sensitivity' checkbox unchecked, as performance is improved. The calculation and comparison of checksums for each row fetched carries an overhead. If this option is enabled, the table oplrvc must have been created beforehand using the appropriate script for the target database.
    • MaxRows Override: Allows you to define a limit on the maximum number of rows to be returned from a query. The default value of 0 means no limit.
    • Disable AutoCommit: Changes the default commit behavior of the OpenLink driver. The default mode is AutoCommit (box unchecked).
    • Defer fetching of long data: Defers fetching of LONG (BINARY, BLOB, etc.) data unless explicitly requested in a query. This provides significant performance increases when fields in a query do not include LONG data fields.
    • Catalogs return Owner: Check this box so that ODBC API catalog calls return values in catalog columns as the database owner or schema.
    • Multiple Active Statements Emulation: Enables the use of Multiple Active statements in an ODBC application even if the underlying database does not allow this, as it is emulated in the driver.
    • Always include VIEWS in table list: This switch is needed for Microsoft Excel and Query, Stata, and some other tools which explicitly request only TABLEs from the back-end DBMS. Tick this box if you also need to see VIEWS in the graphical query builder. This option is redundant when Always include all types is ticked.
    • Always include all types in table list: This switch is needed for Microsoft Excel and Query, Stata, and some other tools which explicitly requestonly TABLEs from the back-end DBMS. Tick this box if you also need to see SYSTEM TABLEs, VIEWs, SYSTEM VIEWs, SYNONYMs, GLOBAL TEMPORARYs, ALIASes, and/or LOCAL TEMPORARYs in the graphical query builder. Note: the TABLE list will be much longer than when this box is not ticked, and SYSTEM objects will be sorted to the top of the list, due to typical naming conventions.
  7. When finished, click the Finish button to save your new Data Source Name.