ODBC Driver 13.1 for Linux Released
This post is authored by Meet Bhagdev, Program Manager, Microsoft
Hi all. We are delighted to share the Production Ready Release of the Microsoft ODBC Driver 13.1 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.
Added
-
BCP API support
- You can use functions through the ODBC driver as described here on Linux.
-
Support for user-defined KeyStoreProvider for Always Encrypted
- You can now user-defined/created AE Column Master Key keystore providers. Check out code samples and more information here.
-
Ubuntu 16.10 support
- Developed a package Ubuntu 16.10 for an apt-get experience.
-
Dependency on the platform unixODBC Driver Manager instead of the custom unixODBC-utf16 Driver Manager
- This avoids conflicts with applications/software that depends on the platform unixODBC Driver Manager.
Fixed
-
msqobcsql.h (Connect issues 3115331, 3114970)
- Missing definitions for AE, BCP and SQL Server specific types were added
-
TRUST_SERVER_CERTIFICATE connection attribute is always yes (Connect 3116639)
- Setting the TRUST_SERVER_CERTIFICATE connection attribute to anything other than yes failed to set the attribute value. This has been corrected.
-
Fixed Connect issue 2693027 — Memory Leak
- We detected this issue independently of the bug report using valgrind. The memory leak has been fixed.
-
Driver failure when connecting with more than 1,024 handles
- Switched away from libio select. Driver now supports (theoretical) handle limit of 64K or platform max.
-
Intermittent commlinkfailure when using Azure DW
- In some high-latency scenarios over an encrypted channel, the driver could fail unexpectedly. This has been resolved.
Install the ODBC Driver for Linux on Ubuntu 15.10
sudo su
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add –
curl https://packages.microsoft.com/config/ubuntu/15.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.4.0-1
sudo apt-get install unixodbc-dev
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.4.0-1
sudo apt-get install unixodbc-dev
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.4.0-1
sudo apt-get install 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.4.0-1
sudo yum install unixODBC-devel
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.4.0-1
sudo yum install unixODBC-devel
Install the ODBC Driver for SLES 12
sudo su
zypper ar https://packages.microsoft.com/config/sles/12/prod.repo
zypper update
exit
sudo ACCEPT_EULA=Y zypper install msodbcsql-13.1.4.0-1
sudo zypper install unixODBC-devel
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)