BookmarkSubscribeRSS Feed
CHUNantes
Obsidian | Level 7

Hello.

 

On our RHEL 7 server, we have  configured in /etc/odbc.ini the connection to a MySQL server :

 

[Logos]
Description = Logos Prod
Driver = MySQL
Server = logoswprd
Port = 3306
Database = logos
User = logos_ro
Password = xxxxxxxxxxx
Option = 3

Using isql command, we can connect to the database (located on a different server) and query a table :

 

 

>isql -v Logos
+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |
+---------------------------------------+
SQL> select * from codep
+--------+-------------------------------+
| CODP   | VILLE                         |
+--------+-------------------------------+
| 44370  | LA ROUXIERE                   |
| 44240  | LA CHAPELLE SUR ERDRE         |
| 900110 | SIDI BOUZI                    |
| 44300  | NANTES                        |
| 44000  | NANTES                        |
| 44103  | NANTES CEDEX 4                |
| 44981  | STE LUCE SUR LOIRE CEDEX      |
| 44036  | NANTES CEDEX 1                |
| 44036  | NANTES CEDEX 1                |
| 44100  | NANTES                        |
| 44300  | NANTES                        |
+--------+-------------------------------+
SQLRowCount returns 11
11 rows fetched
SQL> quit

But when we try to connect from SAS :

 

 

libname logos odbc datasrc="Logos";

ERROR: CLI error trying to establish connection: [unixODBC][MySQL][ODBC 5.2(w) Driver]Can't
connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
ERROR: Error in the LIBNAME statement.

Of course, we don't have a socket opened on our server because we don't have a MySQL server running on our server.

 

But why SAS did not use the informations stored on the odbc.ini file to connect to the MySQL server ?

When we look at the paths stored on the LD_LIBRARY_PATH in the SAS session :

/app/sas/sashome/Secure/sasexe
/app/sas/sashome/SASODBCDriversfortheWebInfrastructurePlatformDataServer/9.4/Driver
/app/sas/sashome/SASPrivateJavaRuntimeEnvironment/9.4/jre/lib/amd64/server
/app/sas/sashome/SASPrivateJavaRuntimeEnvironment/9.4/jre/lib/amd64
/app/sas/sashome/SASFoundation/9.4/sasexe
/app/oracle/product/19.0.0/client_1/lib

We found odbcinst.ini and odbc.ini files in /app/sas/sashome/SASODBCDriversfortheWebInfrastructurePlatformDataServer/9.4/Driver so we overwrite thoses files with /etc files but we have the same issue.

 

How to configure SAS to use the right files and connect to the right MySQL server ?

 

Thanks for your help

 

 

Catch up on SAS Innovate 2026

Dive into keynotes, announcements and breakthroughs on demand.

Explore Now →
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 0 replies
  • 560 views
  • 0 likes
  • 1 in conversation