SUSE Support

Here When You Need Us

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 15 all service packs
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

Install glibc-locale-base to satisfy a missing dependency requirement:
zypper install -y mssql-tools18 unixODBC-devel glibc-locale-base
Below are the complete installation steps for Microsoft SQL Server Tools:

1. Enter superuser mode.
sudo su
2. Import the Microsoft package signing key.

2a. Download the Microsoft package signing key:
curl -O https://packages.microsoft.com/keys/microsoft.asc
2b.Import the Microsoft package signing key:
rpm --import microsoft.asc​​
3. 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.repo
3b. For SLES 12, use the following command:
zypper addrepo https://packages.microsoft.com/config/sles/12/prod.repo
4. 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-base
4b. For SLES 12, use the following command:
zypper install -y mssql-tools18 unixODBC-devel
NOTE:  To update to the latest version of mssql-tools18, run the following commands:
zypper refresh
zypper update mssql-tools18 
5. Exit superuser mode.
exit
6. 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_profile
6b. 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

Missing depenency glibc-locale-base for Microsoft unixODBC-devel package.

Status

Top Issue

Additional Information

Due to packaging changes in SLES 15, the unixODBC-devel​ package should require glibc-locale-base​.

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 
 
Microsoft has updated its official documentation to reflect the extra package installation for SLES 15 vs. SLES 12.
 
https://learn.microsoft.com/en-us/sql/linux/quickstart-install-connect-suse?view=sql-server-ver16#tools
 

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

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.