·
3 min read

ODBC Driver 13.0 for SQL Server – Linux is now released

This post is authored by Meet Bhagdev.

We are delighted to share the full release 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 on Linux.

What’s new

  • Native Linux Install Experience: The driver can now be installed with apt-get (Ubuntu), yum (RedHat/CentOS) and Zypper (SUSE). Instructions on how to do this is below.
  • AlwaysOn Availability Groups (AG): The driver now supports transparent connections to AlwaysOn Availability Groups. The driver quickly discovers the current AlwaysOn topology of your server infrastructure and connects to the current active server transparently.
  • TLS 1.2 support: The driver now supports TLS 1.2 connections to SQL Server.

Install the ODBC Driver for Linux on Ubuntu 15.04

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

Install the ODBC Driver for Linux on Ubuntu 15.10

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

Install the ODBC Driver for Linux on Ubuntu 16.04

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

Install the ODBC Driver for Linux on RedHat 6

1. sudo su
2. yum-config-manager --add-repo https://apt-mo.trafficmanager.net/yumrepos/mssql-rhel6-release/
3. yum-config-manager --enable mssql-rhel6-release
4. wget "http://aka.ms/msodbcrhelpublickey/dpgswdist.v1.asc"
5. rpm --import dpgswdist.v1.asc
6. yum remove unixODBC #to avoid conflicts during installation
7. yum update
8. yum install msodbcsql
9. yum install unixODBC-utf16-devel #this step is optional but recommended*

Install the ODBC Driver for Linux on RedHat 7

1. sudo su
2. yum-config-manager --add-repo https://apt-mo.trafficmanager.net/yumrepos/mssql-rhel7-release/
3. yum-config-manager --enable mssql-rhel7-release
4. wget "http://aka.ms/msodbcrhelpublickey/dpgswdist.v1.asc"
5. rpm --import dpgswdist.v1.asc
6. yum remove unixODBC #to avoid conflicts during installation
7. yum update
8. yum install msodbcsql
9. yum install unixODBC-utf16-devel #this step is optional but recommended*

Install the ODBC Driver for SUSE12

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

Note: Packages for SQL Server command line tools will be available soon. The above mentioned packages only install the ODBC Driver for SQL Server that enable connectivity from any C/C++ application.

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:

If you installed the driver using the manual instructions, 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!

Survey and 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.

Please stay tuned for upcoming releases that will have additional feature support and bug fixes. This applies to our wide range of client drivers including PHP 7.0, Node.js, JDBC and ADO.NET which are already available.