The error "Can't connect to local MySQL server through socket" might occur in SAS/ACCESS® Interface to MySQL


When you assign a LIBNAME statement that contains the SERVER=local–host option in the SAS/ACCESS Interface to MySQL, you might receive the following error message:

ERROR: Error trying to establish connection: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
ERROR: Error in the LIBNAME statement.

This error does not display when you use the option SERVER=server–name because the file mysql.sock has been deleted from its current location.

To avoid the error, put the mysql.sock file in a permanent location, then specify the new location with the environment variable MYSQL_UNIX_PORT=.