Installing SQL Server Tools on SUSE Linux

By:   |   Comments   |   Related: > SQL Server on Linux


In a previous tip, I showed how to install SQL Server vNext on SUSE Linux. In this tip, we will show how to install MSSQL tools to establish a database connection to SQL Server on SUSE Linux.


As discussed in my last couple of tips, SQL Server vNext does not install the sqlcmd or BCP during the SQL Server installation on Linux servers.  We need sqlcmd to make a database connection on the Linux server, so I will show the installation of these tools to make database connections on the SUSE Linux server.

MSSQL Tools Installation on SUSE Linux

Before going ahead, you need to have SUSE Linux with SQL Server vNext installed on that machine.

Step 1:

First connect to the target SUSE Linux server on which you have installed SQL Server vNext. You can directly connect to the server or you can use PuTTY a third party tool to make a server connection. I used PuTTY to login to this server. I launched PuTTY and entered the IP address of the SUSE Linux server and then clicked on the open button. A black screen known as the PuTTY terminal will appear asking you to enter the login information to connect to the target server. I entered the login name followed by the password to make a connection as shown below.

connect using PUTTY to SUSE Linux

Step 2:

You can see that I connected to this SUSE Linux server. Now let's check and verify the SQL Server installation on this machine. Run the below command to check the mssql-server service.

#check the status of mssql-server service.
systemctl status mssql-server
Check mssql-server service

We can see the service status is enabled and active (running) which is highlighted in green. This means SQL Server is installed and running fine on this server.

Step 3:

Next we will install the MSSQL tools on this server. Before going ahead we can verify whether the mssql tools are installed on this machine or not. You can type sqlcmd and press enter, if you will get details about this utility that means this tool is already on the server. I did this and you can see sqlcmd is not recognized by SUSE Linux, so the next step is to install it on this machine.

Check sqlcmd utility

We need to add the SQL Server repository to zypper. This repository will be used to install MSSQL tools on this machine, so to add the SQL Server repository to zypper run the below command.

#Add repository to Zypper.
sudo zypper addrepo -fc 
Add repository to zypper

You can see that command has executed successfully. Now execute the below command to refresh the keys.

sudo zypper --gpg-auto-import-keys refresh
import and refresh keys

Next check the list of repositories by running the below zypper command.

#Get the list of repositories
zypper lr
zypper lr

Step 4:

Now our next step is to install the MSSQL tools with the unixODBC developer package on this box by using this zypper command.

#Install MSSQL tools
sudo zypper install mssql-tools unixODBC-devel
install SQL Server tools

Once execution starts, it will read the package list followed by checking the dependencies. It will display the name of the target packages which will be installed along with this installation. Now it will ask you to choose y or n to proceed with the installation. Type y to choose yes. Once you press enter the download process for all required packages will be started as shown below.

install SQL Server tools

You can see the progress bar for the packages which are in process to download. Every package will ask you to enter YES to accept the license terms during installation as shown below. You will get the below screen to accept the license terms. Choose YES and press enter to proceed.

Accept the license terms during installing SQL Server tools

Once you press enter, execution will resume in the PuTTY terminal. Once installation is done for this package, the next window will ask you to accept the license terms again for the next package similar to the above screenshot.

Accept the license terms during installing SQL Server tools

We can see mssql tools have been installed on this machine as shown in the below image. Now we will check and validate this.

Accept the license terms during installing SQL Server tools

Step 5:

Now we will check and verify whether the sqlcmd utility is installed to access SQL Server on this machine. Type sqlcmd and press enter to check the details of this utility.

#check sqlcmd utility.

We can see that sqlcmd command is recognized by the SUSE Linux server and the output of this command shows that sqlcmd is installed and ready for use.

sqlcmd validation

Next we will validate sqlcmd by making a database connection to the SUSE Linux server. Run the below command to connect to the database engine from the SUSE Linux server.

#Run sqlcmd to make database connection.
#You need to pass server name/IP address with -S, user name with -U. Enter the password of sa account once you get the Password prompt.
sqlcmd -S192.168.209.130 -Usa

Once you execute the command, a SQL Server prompt will appear with cursor 1>.

I executed "SELECT @@VERSION" to check the version of SQL Server which is shown below.

run select @@version

Step 6:

Below I will run this code in sqlcmd to create a new database named "Manvendra" and then query sysdatabases to list all of the databases.

#Create a db named Manvendra

#Check database name in sysdatabases system table.
#Run this command on sqlcmd prompt only.
SELECT name from sysdatabases

We can see there are 5 databases including database "Manvendra".

check sysdatabases table

We have validated that we can connect to SQL Server vNext database engine using sqlcmd on the SUSE Linux server.

Next Steps
  • Go ahead and make database connections on SUSE Linux server and get more exposure on this new SQL Server offering.
  • Explore more knowledge on SQL Server on Linux Tips

sql server categories

sql server webinars

subscribe to mssqltips

sql server tutorials

sql server white papers

next tip

About the author
MSSQLTips author Manvendra Singh Manvendra Singh has over 5 years of experience with SQL Server and has focused on Database Mirroring, Replication, Log Shipping, etc.

This author pledges the content of this article is based on professional experience and not AI generated.

View all my tips

Comments For This Article

get free sql tips
agree to terms