Documentation Home
Connectors and APIs Manual
Download this Manual
PDF (US Ltr) - 4.5Mb
PDF (A4) - 4.5Mb


Connectors and APIs Manual  /  ...  /  Installing Connector/ODBC on macOS

5.4.3 Installing Connector/ODBC on macOS

macOS is based on the FreeBSD operating system, and you can normally use the MySQL network port for connecting to MySQL servers on other hosts. Installing the Connector/ODBC driver lets you connect to MySQL databases on any platform through the ODBC interface. If your application requires an ODBC interface, install the Connector/ODBC driver.

On macOS, the ODBC Administrator, based on the iODBC manager, provides easy administration of ODBC drivers and configuration, allowing the updates of the underlying iODBC configuration files through a GUI tool. The tool is included in macOS v10.5 and earlier; users of later versions of macOS need to download it from http://www.iodbc.org/dataspace/doc/iodbc/wiki/iodbcWiki/Downloads and install it manually.

Prerequisites

  • iODBC

  • OpenSSL is a required dependency. The macOS installation binaries bundle OpenSSL, while the compressed tar archives do not and require that you install OpenSSL on your system before the installation process.

  • C++ runtime libraries (libc++)

There are two ways to install Connector/ODBC on macOS. You can use either the package provided in a compressed tar archive that you manually install, or use a compressed disk image (.dmg) file, which includes an installer.

To install using the compressed tar archive (some of the steps below might require superuser privileges):

  1. Download the compressed tar archive.

  2. Extract the archive:

    $> tar xvzf mysql-connector-odbc-x.y.z-macos10.z-x86-(32|64)bit.tar.gz
  3. The directory created contains two subdirectories, lib and bin. Copy these to a suitable location such as /usr/local:

    $> cp bin/* /usr/local/bin
    $> cp lib/* /usr/local/lib
  4. Finally, register the driver with iODBC using the myodbc-installer tool that was included in the package:

    $> myodbc-installer -a -d -n "MySQL ODBC 9.1 Driver" -t "Driver=/usr/local/lib/libmyodbc9w.so"

To install using the a compressed disk image (.dmg) file:

Important

iODBC 3.52.12 or later must be installed on the macOS system before you can install Connector/ODBC using a compressed disk image. See Section 5.4.3, “Installing Connector/ODBC on macOS”.

  1. Download the disk image.

  2. Double click the disk image to open it. You see the Connector/ODBC installer inside.

  3. Double click the Connector/ODBC installer, and you will be guided through the rest of the installation process. You need superuser privileges to finish the installation.

To verify the installed drivers, either use the ODBC Administrator application or the myodbc-installer utility:

$> myodbc-installer -d -l