首页 > 解决方案 > Unable to connect MySQL to SAS

问题描述

I am trying to connect MySQL in SAS. But I am getting the below error when I am running the libname statement. Can anyone help me out to sort out this issue.

libname mysqllib mysql path= "C:\Program Files\MySQL\MySQL Shell 8.0\bin\" 
user="root" password="password" database="sample" server="localhost" 
port=3306;

ERROR: The SAS/ACCESS Interface to MYSQL cannot be loaded. The libmysql code appendage could not be loaded. ERROR: Error in the LIBNAME statement.

标签: sassas-macro

解决方案


The following error might be issued when you access MySQL using SAS/ACCESS Interface to MySQL:

ERROR: The SAS/ACCESS Interface to MYSQL cannot be loaded. The libmysql code appendage could not be loaded.

This error might be issued because the MySQL client is not listed in the system path or the UNIX environment variables are not set appropriately.

You need to make sure that the location of the libmysql.dll file is in your Windows system PATH. Under UNIX, make sure that the LIBPATH, SHLIB_PATH, or LD_LIBRARY_PATH environment variables are set to the MySQL client libraries, and that they are set correctly.

If you have verified that the libmysql.dll file is in your system path and you still get the above error, search your machine for all instances of the libmysql.dll file to make sure that another copy does not exist in a directory on the path.


Another possible cause might be, that there is a different bitnesss between SAS and MySQL or the system requirements are not met:

http://support.sas.com/documentation/installcenter/en/ikfdtnwx6sr/66390/PDF/default/sreq.pdf page 20.


推荐阅读