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 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

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 (0)

Skip to main content