Servicing Update for ODBC Driver 13.1 for Linux and macOS Released


Hi all, we are delighted to share the servicing update of the Microsoft ODBC Driver 13.1 for Linux and macOS. The new driver enables access to SQL Server, Azure SQL Database and Azure SQL DW from any C/C++ application on Linux and macOS.

Added

  • Ubuntu 14.04, 17.04, Debian Jessie and SUSE Enterprise Linux 11 SP4 support
    • Use apt-get, and zypper to install the driver
  • Azure Active Directory Authentication support (username/password) for Linux and macOS
    • Get started with Azure AD by checking out the docs here
  • Configurable driver location on Linux
    • Simply copy the whole driver install directory to the location of your choice after normal installation.

Fixed

  • Issue with Floating-point numbers formatted incorrectly in French locale
  • Issue with SQLBindParameter input/output parameters truncating prematurely
  • Implicit cursor conversion due to comments
  • Buffer overrun upon UTF-8 character conversion
  • Symbolic link creation for the RPM package

Install the ODBC Driver for Linux on Debian Jessie 8

sudo su
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
curl https://packages.microsoft.com/config/debian/8/prod.list > /etc/apt/sources.list.d/mssql-release.list
exit
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get -y install msodbcsql=13.1.9.0-1

Install the ODBC Driver for Linux on Ubuntu 14.04

sudo su 
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
curl https://packages.microsoft.com/config/ubuntu/14.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
exit
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install msodbcsql=13.1.9.0-1 unixodbc-dev
source ~/.bashrc

Install the ODBC Driver for Linux on Ubuntu 16.04

sudo su 
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
exit
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install msodbcsql=13.1.9.0-1 mssql-tools=14.0.6.0-1 unixodbc-dev
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
source ~/.bashrc

Install the ODBC Driver for Linux on Ubuntu 16.10

sudo su 
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
curl https://packages.microsoft.com/config/ubuntu/16.10/prod.list > /etc/apt/sources.list.d/mssql-release.list
exit
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install msodbcsql=13.1.9.0-1 mssql-tools=14.0.6.0-1 unixodbc-dev
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
source ~/.bashrc

Install the ODBC Driver for Linux on Ubuntu 17.04

sudo su 
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
curl https://packages.microsoft.com/config/ubuntu/17.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
exit
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install msodbcsql=13.1.9.0-1 unixodbc-dev

Install the ODBC Driver for Linux on RedHat 6

sudo su
curl https://packages.microsoft.com/config/rhel/6/prod.repo > /etc/yum.repos.d/mssql-release.repo
exit
sudo yum remove unixODBC-utf16 unixODBC-utf16-devel #to avoid conflicts
sudo ACCEPT_EULA=Y yum install msodbcsql-13.1.9.0-1 mssql-tools-14.0.6.0-1
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
source ~/.bashrc

Install the ODBC Driver for Linux on RedHat 7

sudo su
curl https://packages.microsoft.com/config/rhel/7/prod.repo > /etc/yum.repos.d/mssql-release.repo
exit
sudo yum remove unixODBC-utf16 unixODBC-utf16-devel #to avoid conflicts
sudo ACCEPT_EULA=Y yum install msodbcsql-13.1.9.0-1 mssql-tools-14.0.6.0-1 unixODBC-devel
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
source ~/.bashrc

Install the ODBC Driver for SLES 11

Note: For SLES 11, make sure you enable the security module before you install the driver. The driver uses newer versions of openssl and crypto libraries that are available via the module.

sudo su 
zypper ar https://packages.microsoft.com/config/sles/11/prod.repo 
exit 
sudo ACCEPT_EULA=Y zypper install msodbcsql-13.1.9.0-1 unixODBC-devel
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
source ~/.bashrc

Install the ODBC Driver for SLES 12

sudo su 
zypper ar https://packages.microsoft.com/config/sles/12/prod.repo 
exit 
sudo ACCEPT_EULA=Y zypper install msodbcsql-13.1.9.0-1 mssql-tools-14.0.6.0-1 unixODBC-devel
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
source ~/.bashrc

Try our Sample

Once you install the driver that runs on a supported Linux distro, you can use this C sample to connect to SQL Server/Azure SQL DB/Azure SQL DW. To download the sample and get started, follow these steps:

wget "https://raw.githubusercontent.com/Microsoft/sql-server-samples/master/samples/tutorials/c/linux/sample_c_linux.c"
gcc sample_c_linux.c -o sample_c_linux -lodbc -w #make sure you change the servername, username and password in the connections string
./sample_c_linux

If you installed the driver using the manual instructions found here, you will have to manually uninstall the ODBC Driver and the unixODBC Driver Manager to use the deb/rpm packages. If you have any questions on how to manually uninstall, feel free to leave a comment below. 

Please fill bugs/questions/issues on our Issues page. We welcome contributions/questions/issues of any kind. Happy programming!

Meet Bhagdev (meetb@microsoft.com)

sql-loves-linux_2_twitter-002


Comments (5)

  1. adisapir says:

    I’m trying to run this on top of the official Python container for Docker (FROM python:latest), which is based on Debian 8. However, having issues when running “RUN ACCEPT_EULA=Y apt-get -y install msodbcsql”
    Perhaps it’s my minor experience with this environment but has anyone ran such a configuration successfully?

      1. adisapir says:

        Thanks! I’ll look into it.
        Running as-is I’m getting the following error:
        “E: Package ‘locales’ has no installation candidate” (right after then RUN apt-get install -y locales…) line

        Also, I would probably work to change this to run with Python 3.6 instead of 2.x

        Thanks!

  2. Ahmed Mohammed says:

    Hi Bhagdev,
    We have SAP System running on SUSE Linux SP4 , I followed the steps mentioned and installed the following ” msodbcsql-13.1.9.0-1 ” .
    However I get the error
    command-not-found sqlcmd

    Also I don’t find sqlcmd file on my server.
    I performed all the steps as mentioned in the sapnote
    1644499 – Database connectivity from Linux to SQL Server

    Could you please let me know if I am missing something

    1. Meet Bhagdev says:

      Hello Ahmed, we are still working on the SLES 11 package for mssql-tools. Stay tuned for updates.

Skip to main content