User guide
Configuring Environment Variables for Driver Configuration Files
In order for the Amazon Redshift ODBC driver to function properly, you need to set a number of
environmental variables, as described following.
Set an environment variable to specify the path to the driver manager libraries:
• On Linux, set LD_LIBRARY_PATH to point to the directory containing the driver manager libraries. For
more information on supported driver managers, see Install the Amazon Redshift ODBC Driver on
Linux Operating Systems (p. 148).
• On Mac OS X, set DYLD_LIBRARY_PATH to point to the directory containing the driver manager libraries.
For more information on supported driver managers, see Install the Amazon Redshift ODBC Driver on
Mac OS X (p. 150).
Optionally, set AMAZONREDSHIFTODBCINI to point to your amazon.redshiftodbc.ini file.
AMAZONREDSHIFTODBCINI must specify the full path, including the file name.You must either set this
variable, or place this file in a location where the system will find it in a search.The following search order
is used to locate the amazon.redshiftodbc.ini file:
1. If the AMAZONREDSHIFTODBCINI environment variable is defined, then the driver searches for the file
specified by the environment variable.
2. The current working directory of the application is searched for a file named amazon.redshiftodbc.ini
not beginning with a period.
3. The directory ~/ (that is, $HOME) is searched for a hidden file named .amazon.redshiftodbc.ini.
4. The directory /etc is searched for a file named amazon.redshiftodbc.ini not beginning with a period.
If you decide to use a directory other than the user's home directory for the odbc.ini and odbcinst.ini files,
you also need to set environment variables to specify where the configuration files appear:
• Set ODBCINI to point to your odbc.ini file.
• Set ODBCSYSINI to point to the directory containing the odbcinst.ini file.
If you are on Linux, your driver manager libraries are located in the /usr/local/lib directory, your odbc.ini
and amazon.redshiftodbc.ini files are located in the /etc directory, and your odbcinst.ini file is located in
the /usr/local/odbc directory, then set the environment variables as shown in the following example:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export ODBCINI=/etc/odbc.ini
export AMAZONREDSHIFTODBCINI=/etc/amazon.redshiftodbc.ini
export ODBCSYSINI=/usr/local/odbc
If you are on Mac OS X, your driver manager libraries are located in the /usr/local/lib directory, your
odbc.ini and amazon.redshiftodbc.ini files are located in the /etc directory, and your odbcinst.ini file is
located in the /usr/local/odbc directory, then set the environment variables as shown in the following
example:
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/usr/local/lib
export ODBCINI=/etc/odbc.ini
export AMAZONREDSHIFTODBCINI=/etc/amazon.redshiftodbc.ini
export ODBCSYSINI=/usr/local/odbc
API Version 2012-12-01
154
Amazon Redshift Management Guide
Configuring Connections in Amazon Redshift