Search
StarWind is a hyperconverged (HCI) vendor with focus on Enterprise ROBO, SMB & Edge

Ubuntu: Manage your SQL Server from Linux

  • August 15, 2016
  • 6 min read
Cloud and Virtualization Architect. Florent is specializing in public, hybrid, and private cloud technologies. He is a Microsoft MVP in Cloud and Datacenter Management and an MCSE in Private Cloud.
Cloud and Virtualization Architect. Florent is specializing in public, hybrid, and private cloud technologies. He is a Microsoft MVP in Cloud and Datacenter Management and an MCSE in Private Cloud.

We will see how to install and use tools to manage your SQL Servers. We will use the version 13, who is compatible with Ubuntu. You can use these drivers from SQL Server 2008 to 2016, and it’s compatible with Azure SQL Database too.

ubuntu

To start, install prerequisites that will be necessary to install the sqlcmd on Linux:

sqlcmd on Linux

We will download and install Microsoft ODBC Drivers for SQL Server for Linux:

Microsoft ODBC Drivers for SQL Server for Linux

Move in the folder that you extracted. You will have a file named build_dm.sh. This file will download and compile ODBC drivers, in version 12.3.1:

ODBC drivers

Execute it with the following command to download drivers and do the compilation. Answer YES to the question to accept the license:

Ubuntu command

As it’s indicated, to finish the installation, you have to execute the command

Ubuntu command

To do this, you have to be root. I will move to root, with the command

Ubuntu command

And launch the command:

Ubuntu command

By default, libraries are installed in /usr/lib64. Exit root with the exit command.

We will now launch the installation of ODBC Drivers for SQL Server. Execute the following command to save the file odbcinst.ini:

Ubuntu command

Before starting the installation, we will verify that all prerequisites are installed correctly:

Ubuntu command

All is fine, we can start the installation with the following command :

Ubuntu command

Before using the tool sqlcmd, we need to verify that the /ust/lib64 folder is referenced in the ld.so.conf file:

Ubuntu command

If, like me, you don’t have /usr/lib64, you need to add it:

Ubuntu command

Execute the following command to reload the configuration file that we just modified:

Ubuntu command

You can verify that the installation is complete with the following command:

Ubuntu command

You can connect to your SQL Server to do requests, with the command:


Ubuntu command

I have a problem for the authentication with my Active Directory account, by using the Windows authentication:

Ubuntu command

Then on the SQL Server, I don’t have any problem:

Ubuntu command

I will update this post when I will find the problem.

Enjoy 🙂

Related materials: 

Hey! Found Florent’s insights useful? Looking for a cost-effective, high-performance, and easy-to-use hyperconverged platform?
Taras Shved
Taras Shved StarWind HCI Appliance Product Manager
Look no further! StarWind HCI Appliance (HCA) is a plug-and-play solution that combines compute, storage, networking, and virtualization software into a single easy-to-use hyperconverged platform. It's designed to significantly trim your IT costs and save valuable time. Interested in learning more? Book your StarWind HCA demo now to see it in action!