Microsoft SQL Server command-line tools installation fails on SLES 15 SP1-SP5
This document (000021236) is provided subject to the disclaimer at the end of this document.
Environment
SUSE Linux Enterprise Server for SAP Applications 15 all service packs
Situation
Customer installation of Microsoft SQL Server command-line tools (MS SQL client / mssql-tools18 / sqlcmd) fails on SLES 15.
Attempts to connect to Microsoft SQL Server databases from command-line fail to connect with following error:
command-line> php sql.php Array ( [0] => Array ( [0] => IM004 [SQLSTATE] => IM004 [1] => 0 [code] => 0 [2] => [unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_HENV failed [message] => [unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_HENV failed ) )
Resolution
zypper install -y mssql-tools18 unixODBC-devel glibc-locale-baseBelow are the complete installation steps for Microsoft SQL Server Tools:
1. Enter superuser mode.
sudo su2. Import the Microsoft package signing key.
2a. Download the Microsoft package signing key:
curl -O https://packages.microsoft.com/keys/microsoft.asc2b.Import the Microsoft package signing key:
rpm --import microsoft.asc3. Add the SQL Server repository to zypper.
3a. For SLES 15, use the following command:
zypper addrepo https://packages.microsoft.com/config/sles/15/prod.repo3b. For SLES 12, use the following command:
zypper addrepo https://packages.microsoft.com/config/sles/12/prod.repo4. Install the mssql-tools18 package with unixODBC developer package.
4a. For SLES 15, use the following command:
zypper install -y mssql-tools18 unixODBC-devel glibc-locale-base4b. For SLES 12, use the following command:
zypper install -y mssql-tools18 unixODBC-develNOTE: To update to the latest version of mssql-tools18, run the following commands:
zypper refresh
zypper update mssql-tools18
exit6. Optional: Add /opt/mssql-tools18/bin/ to your PATH environment variable in your Bash shell.
6a. To make sqlcmd and bcp accessible from the Bash shell for login sessions, modify your PATH in the ~/.bash_profile file with the following command:
echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bash_profile6b. To make sqlcmd and bcp accessible from the Bash shell for interactive/non-login sessions, modify the PATH in the ~/.bashrc file with the following command:
echo `export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrc source ~/.bashrc
Cause
Status
Additional Information
This was not reflected in Microsoft's official installation guidance, causing installation on SLES 15 vs. SLES 12 to fail.
SUSE updated its unixODBC-devel package appropriately, but it is the Microsoft unixODBC-devel package that is installed by the customer.
Microsoft now expects to patch its unixODBC-devel package by the end of October 2023
Disclaimer
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.
- Document ID:000021236
- Creation Date: 11-Oct-2023
- Modified Date:12-Oct-2023
-
- SUSE Linux Enterprise Server
- SUSE Linux Enterprise Server for SAP Applications
For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com