<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Connect SAS to MySQL using ODBC on Linux server in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Connect-SAS-to-MySQL-using-ODBC-on-Linux-server/m-p/983956#M379625</link>
    <description>&lt;P&gt;Hello.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;On our RHEL 7 server, we have&amp;nbsp; configured in /etc/odbc.ini the connection to a MySQL server :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;[Logos]
Description = Logos Prod
Driver = MySQL
Server = logoswprd
Port = 3306
Database = logos
User = logos_ro
Password = xxxxxxxxxxx
Option = 3&lt;/PRE&gt;
&lt;P&gt;Using isql command, we can connect to the database (located on a different server) and query a table :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&amp;gt;isql -v Logos
+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |
+---------------------------------------+
SQL&amp;gt; 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&amp;gt; quit&lt;/PRE&gt;
&lt;P&gt;But when we try to connect from SAS :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname logos odbc datasrc="Logos";&lt;BR /&gt;&lt;BR /&gt;ERROR: CLI error trying to establish connection: [unixODBC][MySQL][ODBC 5.2(w) Driver]Can't&lt;BR /&gt;connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)&lt;BR /&gt;ERROR: Error in the LIBNAME statement.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Of course, we don't have a socket opened on our server because we don't have a MySQL server running on our server.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But why SAS did not use the informations stored on the odbc.ini file to connect to the MySQL server ?&lt;/P&gt;
&lt;P&gt;When we look at the paths stored on the&amp;nbsp;LD_LIBRARY_PATH in the SAS session :&lt;/P&gt;
&lt;PRE&gt;/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&lt;/PRE&gt;
&lt;P&gt;We found odbcinst.ini and odbc.ini files in&amp;nbsp;/app/sas/sashome/SASODBCDriversfortheWebInfrastructurePlatformDataServer/9.4/Driver so we overwrite thoses files with /etc files but we have the same issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How to configure SAS to use the right files and connect to the right MySQL server ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your help&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 24 Feb 2026 09:46:14 GMT</pubDate>
    <dc:creator>CHUNantes</dc:creator>
    <dc:date>2026-02-24T09:46:14Z</dc:date>
    <item>
      <title>Connect SAS to MySQL using ODBC on Linux server</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Connect-SAS-to-MySQL-using-ODBC-on-Linux-server/m-p/983956#M379625</link>
      <description>&lt;P&gt;Hello.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;On our RHEL 7 server, we have&amp;nbsp; configured in /etc/odbc.ini the connection to a MySQL server :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;[Logos]
Description = Logos Prod
Driver = MySQL
Server = logoswprd
Port = 3306
Database = logos
User = logos_ro
Password = xxxxxxxxxxx
Option = 3&lt;/PRE&gt;
&lt;P&gt;Using isql command, we can connect to the database (located on a different server) and query a table :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&amp;gt;isql -v Logos
+---------------------------------------+
| Connected!                            |
|                                       |
| sql-statement                         |
| help [tablename]                      |
| quit                                  |
|                                       |
+---------------------------------------+
SQL&amp;gt; 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&amp;gt; quit&lt;/PRE&gt;
&lt;P&gt;But when we try to connect from SAS :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname logos odbc datasrc="Logos";&lt;BR /&gt;&lt;BR /&gt;ERROR: CLI error trying to establish connection: [unixODBC][MySQL][ODBC 5.2(w) Driver]Can't&lt;BR /&gt;connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)&lt;BR /&gt;ERROR: Error in the LIBNAME statement.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Of course, we don't have a socket opened on our server because we don't have a MySQL server running on our server.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But why SAS did not use the informations stored on the odbc.ini file to connect to the MySQL server ?&lt;/P&gt;
&lt;P&gt;When we look at the paths stored on the&amp;nbsp;LD_LIBRARY_PATH in the SAS session :&lt;/P&gt;
&lt;PRE&gt;/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&lt;/PRE&gt;
&lt;P&gt;We found odbcinst.ini and odbc.ini files in&amp;nbsp;/app/sas/sashome/SASODBCDriversfortheWebInfrastructurePlatformDataServer/9.4/Driver so we overwrite thoses files with /etc files but we have the same issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How to configure SAS to use the right files and connect to the right MySQL server ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for your help&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Feb 2026 09:46:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Connect-SAS-to-MySQL-using-ODBC-on-Linux-server/m-p/983956#M379625</guid>
      <dc:creator>CHUNantes</dc:creator>
      <dc:date>2026-02-24T09:46:14Z</dc:date>
    </item>
  </channel>
</rss>

