Preview 3 of the SQL Server [C/C++] ODBC Driver 13 for Linux is released!


Hi all, we are delighted to share the third early technical preview of the Microsoft ODBC Driver 13 for Linux –  (Ubuntu, RedHat and SUSE). The new driver enables access to SQL Server, Azure SQL Database and Azure SQL DW from any C/C++ application.

The major highlight of this release is a native command line install experience (apt/yum), for RedHat 6.x, 7.x and Ubuntu 15.04, 15.10, 16.04 and SUSE 12. With the native command line install experience, you can use the Microsoft ODBC Driver on OSX via Docker and VirtualBox. This release also adds support for TLS 1.2 connections.

Install the ODBC Driver for Linux on Ubuntu 15.04

sudo su
sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/mssql-ubuntu-vivid-preview/ vivid main" > /etc/apt/sources.list.d/mssqlpreview.list'
sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893
apt-get update
apt-get install msodbcsql
apt-get install unixodbc-dev-utf16 #this step is optional but recommended*

Install the ODBC Driver for Linux on Ubuntu 15.10

sudo su
sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/mssql-ubuntu-preview/ wily main" > /etc/apt/sources.list.d/mssqlpreview.list'
sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893
apt-get update
#If you installed the previous preview, you can upgrade using this command, apt-get --only-upgrade install msodbcsql
apt-get install msodbcsql
apt-get install unixodbc-dev-utf16 #this step is optional but recommended*

Install the ODBC Driver for Linux on Ubuntu 16.04

sudo su
sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/mssql-ubuntu-test/ xenial main" > /etc/apt/sources.list.d/mssqlpreview.list'
sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893
apt-get update
#If you installed the previous preview, you can upgrade using this command, apt-get --only-upgrade install msodbcsql
apt-get install msodbcsql
apt-get install unixodbc-dev-utf16 #this step is optional but recommended*

Install the ODBC Driver for Linux on RedHat 6

sudo su
yum-config-manager --add-repo https://apt-mo.trafficmanager.net/yumrepos/mssql-rhel6-preview/
yum-config-manager --enable mssql-rhel6-preview
wget "http://aka.ms/msodbcrhelpublickey/dpgswdist.v1.asc"
rpm --import dpgswdist.v1.asc
yum remove unixodbc #to avoid conflicts during installation
yum update
#If you installed the previous preview, you can upgrade using this command, yum update msodbcsql
yum install msodbcsql
yum install unixODBC-utf16-devel #this step is optional but recommended*

Install the ODBC Driver for Linux on RedHat 7

sudo su
yum-config-manager --add-repo https://apt-mo.trafficmanager.net/yumrepos/mssql-rhel7-preview/
yum-config-manager --enable mssql-rhel7-preview
wget "http://aka.ms/msodbcrhelpublickey/dpgswdist.v1.asc"
rpm --import dpgswdist.v1.asc
yum remove unixodbc #to avoid conflicts during installation
yum update
#If you installed the previous preview, you can upgrade using this command, yum update msodbcsql
yum install msodbcsql
yum install unixODBC-utf16-devel #this step is optional but recommended*

Install the ODBC Driver for SUSE12

zypper ar https://apt-mo.trafficmanager.net/yumrepos/mssql-sles12-preview/ "mssql" #To add the repo
wget "http://aka.ms/msodbcrhelpublickey/dpgswdist.v1.asc"
rpm --import dpgswdist.v1.asc
zypper remove unixODBC #to avoid conflicts
zypper update
zypper install msodbcsql
zypper install unixODBC-utf16-devel #this step is optional but recommended*

*This package contains the development files (headers and libraries) for unixODBC, an implementation of the ODBC interface for Unix systems.You should install this package if you intend to develop C language applications which use ODBC, or to compile ODBC-using applications from source.

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, feel free to leave a comment below. 

You can find the latest bits on the Microsoft Linux Ubuntu repository and RedHat repository.  We provide limited support while in preview on our Issues page. As always, we welcome contributions/questions/issues of any kind. I’d like to thank everyone on behalf of the team for supporting us in our endeavors to provide you with this preview release. Happy programming!

Future Plans

Going forward we plan to expand SQL Server 16 Feature Support (example: Always Encrypted), improve test coverage, and fix bugs reported on our Issues page.

Meet Bhagdev (meetb@microsoft.com)


Comments (6)

  1. Aaron Steers says:

    Can you please provide info for automating installs? Currently I am blocked by the modal dialog asking for the acceptance of license terms. In the previous version, we were able to accept terms with an “–accept-license” term, but this is not working under apt-get. I’ve tried “-y” and “–force-yes” but neither seems to work.

    Thanks!
    Aaron

    1. Meet Bhagdev says:

      Can you tru : sudo IACCEPTMSODBCSQLLICENSETERMS=YES apt-get install msodbcsql?

      1. Mathew says:

        Unfortunately, The provided command doesn’t work. Do you have other information how to install it without user interaction?
        I tried to install it in docker container based on ubuntu image and it didn’t work.

        > Can you tru : sudo IACCEPTMSODBCSQLLICENSETERMS=YES apt-get install msodbcsql?

        Besides, are you going to support Debian dist in future?

        Thanks in advance.

      2. Meet Bhagdev says:

        Check out our latest release blog for instructions around solent install 🙂 https://blogs.msdn.microsoft.com/sqlnativeclient/2016/10/20/odbc-driver-13-0-for-linux-released/

        We changed the verb to ACCEPT_EULA=Y

  2. William Miteff says:

    When will https://msdn.microsoft.com/library/mt703139.aspx be updated with the newer version and mention support for RHEL 6.x? When can we expect this to be out of preview?

    1. Meet Bhagdev says:

      You should expect it to be out of preview in the next few weeks. The driver will go out of preview first and the tools (SQLCMD,BCP) will follow the suit.

Skip to main content