Step 1: Install the ODBC Driver¶ To install the Snowflake ODBC driver for macOS: If you haven’t already downloaded the driver, download it now. For details, see Downloading the ODBC Driver. Double-click on the downloaded.dmg file, snowflakeodbcmac.dmg. MySQL Connector/ODBC can be used as an ODBC database driver on multiple platforms, such as Mac OS X, Windows and Linux. By installing the MySQL Connector/ODBC driver you will be able to connect to any MySQL databases using the ODBC interface. Microsoft Excel for the Mac includes the ability to import live data from a database using an ODBC connection. This tutorial will describe how you can import sales data from an on-line sales database into your Excel spreadsheet. Once the data is in the spreadsheet, you can use Excel to perform further analysis of your sale data.
ODBC driver managers use configuration files to define and configure ODBC datasources and drivers. To configure an ODBC connection for Mac OS X, note the followingprocedure:
Step 1: Driver Installer Updates Sample Configuration Files
Before you connect to Drill through an ODBC client tool on Mac OS X, the driver installer copies the following configuration files in
/Library/mapr/drill/Setup
to your home directory unless the files already exist in your home directory:mapr.drillodbc.ini
odbc.ini
odbcinst.ini
In your home directory, rename the files as hidden files. Use sudo if necessary:
.mapr.drillodbc.ini
.odbc.ini
.odbcinst.ini
The installer for Mac OS X creates a sample user DSN in
odbc.ini
in either of the following locations:~/Library/ODBC/odbc.ini
~/.odbc.ini
Depending on the driver manager you use, the user DSN in one of these files will be effective.
Note
![Mac Mac](/uploads/1/2/6/4/126483743/468766696.png)
The System and User DSN use different ini files in different locations on OS X.
Step 2: Set Environment Variables
The driver installer installs the
.mapr.drillodbc.ini
file to your home directory and adds an entry to the $HOME/.odbc.ini
file. If you installed the iODBC driver manager using the DMG, the dynamic linker (DYLD) libraries are installed in
/usr/local/iODBC/lib
. The launchd.conf
file contains contents such as the following:Restart the Mac OS X or run
launchctl load /etc/launchd.conf
.Step 3: Define the ODBC Data Sources in .odbc.ini
Define the ODBC data sources in the
~/.odbc.ini
configuration file for your environment. You set the following properties for using Drill in embedded mode:
You set the following properties for using Drill in distributed mode:
Authentication Properties
If the Drillbit requires authentication, uncomment the AuthenticationType, add an AuthenticationType, and configure properties. If the Drillbit does not require authentication (or to configure no password protection), you can use the No Authentication option. You do not need to configure additional settings.
- Kerberos
- See the MIT Kerberos documentation for installing and configuring a Kerberos environment, which is beyond the scope of the information provided here.
- To specify the Kerberos mechanism:
- Set the AuthenticationType to Kerberos.
- Set the KrbServiceHost property to the FQDN of the Drill server host.
- Set the KrbServiceName property to the Kerberos service principal name of the Drill server.
- Plain (or Basic Authentication)
- Configure the UID to an appropriate name for accessing the Drill server.
- Set the PWD property to the password corresponding to the UID.
To configure no password protection, select No Authentication.
Direct and ZooKeeper Quorum Properties
To use Drill in distributed mode, set ConnectionType to Zookeeper, get the ZKQuorum and ZKClusterID values from the
drill-override.conf
file, and define the ZKQuorum and ZKClusterID properties. Format ZKQuorum as a comma separated list of ZooKeeper nodes in the following format:<host name/ip address> : <port number>, <host name/ip address> : <port number>, . . .
For example:
ZKQuorum=centos23:5181,centos28:5181,centos29:5181
ZKClusterID=docs41cluster-drillbits
To use Drill in local mode, do not define the ZKQuorum and ZKClusterID properties. Start Drill using the drill-localhost command, set ConnectionType to Direct, and define HOST and PORT properties. For example:
HOST=<IP address of drillbit>:5181
PORT=31010
Driver Configuration Options describes configuration options available for controlling thebehavior of DSNs using the Drill ODBC Driver.
Sample Configuration File
The following sample shows a possible configuration for using Drill in embedded mode.
Note
The password should be provided in the connection string or ODBC application at connection time, not in the INI file.
Step 4: Configure the Drill ODBC Driver
Configure the Drill ODBC Driver for your environment by modifying the
.mapr.drillodbc.ini
configurationfile. This configures the driver to work with your ODBC driver manager. The following sample shows a possible configuration, which you can use as is if you installed the default iODBC driver manager.Example
Configuring .mapr.drillodbc.ini
To configure the Drill ODBC Driver in the
.mapr.drillodbc.ini
configuration file, complete the following steps:![Odbc For Mac Odbc For Mac](/uploads/1/2/6/4/126483743/535791838.jpg)
- Open the
.mapr.drillodbc.ini
configuration file in a text editor. - Edit the DisableAsync setting if you want to enable a synchronous ODBC connection for performance reasons. Change the default 0 to 1 to disable the asynchronous and enable the synchronous connection. A change in state occurs during driver initialization and is propagated to all driver DSNs.Note: As of version 1.3.8 of the driver, the DriverManagerEncoding setting is automatically detected and set if necessary. The value depends on the driver manager used; it's typically UTF-16 or UTF-32. iODBC uses UTF-32 and unixODBC uses UTF-16.
- Save the
.mapr.drillodbc.ini
configuration file.
Next Step
Refer to Testing the ODBC Connection.
← Configuring ODBC on LinuxConfiguring ODBC on Windows →
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. 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.
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):
- Download the compressed tar archive.
- Extract the archive:
- The directory created contains two subdirectories,
lib
andbin
. Copy these to a suitable location such as/usr/local
: - Finally, register the driver with iODBC using the myodbc-installer tool that was included in the package:For Connector/ODBC 8.0:For Connector/ODBC 5.3:
To install using the a compressed disk image (
.dmg
) file: 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 4.3, “Installing Connector/ODBC on macOS”.
- Download the disk image.
- Double click the disk image to open it. You see the Connector/ODBC installer inside.
- 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.
Mac Os Odbc Manager
To verify the installed drivers, either use the ODBC Administrator application or the myodbc-installer utility: