User guide

Configure the ODBC Driver on Linux and Mac OS X Operating Systems
On Linux and Mac OS X operating systems, you use an ODBC driver manager to configure the ODBC
connection settings. ODBC driver managers use configuration files to define and configure ODBC data
sources and drivers.The ODBC driver manager that you use depends on the operating system that you
use. For more information about the supported ODBC driver managers to configure the Amazon Redshift
ODBC drivers, see System Requirements (p. 148) for Linux operating systems and System
Requirements (p. 150) for Mac OS X operating systems.
Three files are required for configuring the Amazon Redshift ODBC driver:amazon.redshiftodbc.ini,
odbc.ini, and odbcinst.ini.
If you installed to the default location, the amazon.redshiftodbc.ini configuration file is located in
one of the following directories:
/opt/amazon/redshiftodbc/lib/32 (for the 32-bit driver on Linux operating systems)
/opt/amazon/redshiftodbc/lib/64 (for the 64-bit driver on Linux operating systems)
/opt/amazon/redshift/lib/universal (for the driver on Mac OS X)
Additionally, under /opt/amazon/redshiftodbc/Setup on Linux or /opt/amazon/redshift/Setup on Mac OS
X, there are sample odbc.ini and odbcinst.ini files for you to use as examples for configuring the
Amazon Redshift ODBC driver and the data source name (DSN).
We don't recommend using the Amazon Redshift ODBC driver installation directory for the configuration
files.The sample files in the Setup directory are for example purposes only. If you reinstall the Amazon
Redshift ODBC driver at a later time, or upgrade to a newer version, the installation directory is overwritten
and you'll lose any changes you might have made to those files.
To avoid this, you should copy the amazon.redshiftodbc.ini file to a directory other than the installation
directory. If you copy this file to the user's home directory, add a period (.) to the beginning of the file
name to make it a hidden file.
For the odbc.ini and odbcinst.ini files, you should either use the configuration files in the user's home
directory or create new versions in another directory. By default, your Linux or Mac OS X operating system
should have an .odbc.ini file and an .odbcinst.ini file in the user's home directory (/home/$USER or ~/.).
These default files are hidden files, which are indicated by the dot (.) in front of the file name, and they
will only display when you use the -a flag to list the directory contents.
Whichever option you choose for the odbc.ini and odbcinst.ini files, you will need to modify them to add
driver and DSN configuration information. If you chose to create new files, you also need to set environment
variables to specify where these configuration files are located.
Configuring the odbc.ini File
You use the odbc.ini file to define data source names (DSNs).
Use the following format on Linux operating systems:
[ODBC Data Sources]
dsn_name=driver_name
[dsn_name]
Driver=path/driver_file
Host=cluster_endpoint
Port=port_number
API Version 2012-12-01
151
Amazon Redshift Management Guide
Configuring Connections in Amazon Redshift