How to set up Snowflake ODBC driver on Mac with Apple Silicon

How to set up Snowflake ODBC driver on Mac with Apple Silicon

Installing unixODBC

Follow How to set up ODBC in Mac (unixodbc)

Install ODBC driver

Download and install the ODBC Driver for M1 Mac from Snowflake’s website.

Setup

After installation is complete, launch Terminal App, type odbcinst -j and press enter. You will then see the following result.

unixODBC 2.3.9
DRIVERS............ : /opt/homebrew/etc/odbcinst.ini
SYSTEM DATA SOURCES: /opt/homebrew/etc/odbc.ini
FILE DATA SOURCES... : /opt/homebrew/etc/ODBCDataSources
USER DATA SOURCES. : /Users/administrator/.odbc.ini
SQLULEN Size....... SQLULEN Size : 8
SQLLEN Size........ SQLSETPOSIROW Size : 8
SQLSETPOSIROW Size:: 8

Add the Snowflake ODBC driver to the configuration file

In this example, the configuration file /opt/homebrew/etc/odbcinst.ini will hold the odbc driver information. opt/snowflake/snowflakeodbc/lib/libSnowflake.dylib) listed under Driver.

[SnowflakeDSIIDriver]
APILevel=1
ConnectFunctions=YYYY
Description=Snowflake DSII
Driver=/opt/snowflake/snowflakeodbc/lib/libSnowflake.dylib
DriverODBCVer=03.52
SQLLevel=1

If you do not have this section called SnowflakeDSIIDriver, add the above chunk of configuration to this configuration file and save it.

Next, open the configuration file (e.g. /opt/snowflake/snowflakeodbc/lib/simba.snowflake.ini) in the folder where you installed the Snowflake driver. You may need administrator privileges to edit the file.

Then add ODBCInstLib=/opt/homebrew/lib/libodbcinst.dylib to the end of the configuration file. (This path will vary depending on where you have installed homebrew, so please check the path of homebrew installed on your Mac.)

# unixODBC
ODBCInstLib=/opt/homebrew/lib/libodbcinst.dylib

Also comment out ODBCInstLib, which is set by default, by prefixing it with #, as in the following example.

# Generic ODBCInstLib
# iODBC
# ODBCInstLib=libiodbcinst.so

Set the character encoding for the driver manager.

Locate DriverManagerEncoding at the top of the same configuration file (e.g. /opt/snowflake/snowflakeodbc/lib/simba.snowflake.ini). The default may be UTF-32, in which case change it to UTF-16 and save it as follows.

DriverManagerEncoding=UTF-16

Setting the file path of CABundleFile

In the same configuration file (e.g. /opt/snowflake/snowflakeodbc/lib/simba.snowflake.ini), CABundleFile is set as the following example, please check if this file path actually exists.

CABundleFile=/opt/snowflake/snowflakeodbc/lib/cacert.pem

If the path /opt/snowflake/snowflakeodbc/lib/universal/cacert.pem is specified for the CABundle in your environment and this file path does not exist, specify an appropriate file path (for example, remove the universal part, If the path universal/cacert.pem is specified in the CABundle and this file path does not exist, you will need to specify the appropriate file path (for example, remove the universal part).

This will allow the Snowflake driver to work with unixODBC.

For more information on retrieving data, see How to connect to Snowflake and retrieve data into the Exploratory Desktop for more information.