A "Cannot connect to local MySQL" error occurs when you are using SAS/ACCESS® Interface to ODBC


When using SAS/ACCESS Interface to ODBC to connect to MySQL, you might receive the following error message:

Can't connect to local MySQL server through socket '/tmp/mysql.sock'

To resolve the error, set the ODBCSYSINI environment variable to the directory containing the odbc.ini file. Add the following lines to your sasenv_local file, located in !SASROOT/SASFoundation/9.x/bin:

ODBCSYSINI=/location/of/odbcini-file export ODBCSYSINI