Sunday, December 22, 2024
Microsoft SQL Server Linux

SQL Server command line tools, mssql-cli

mssql-cli is new command line tools for SQL Server and it is cross platform and open source. I have seen this is much better than sqlcmd, as IntelliSense is added into the tool. Also the output, query results are very well formatted and easily readable.

Lets go through the steps to install mssql-cli in Linux & in Windows

Steps to install mssql-cli on Linux

  1. Connect to the /etc/yum.repos.d/ directory
cd /etc/yum.repos.d/
mssql-cli install first connect to  /etc/yum.repos.d/ directory

2. Curl the Microsoft Redhat/CentOS repository

sudo curl -O https://packages.microsoft.com/config/centos/8/prod.repo
curl Microsoft Redhat repository prod.repo

3. Rename the prod.repo to msprod.repo

sudo mv prod.repo msprod.repo
mssql-cli install rename prod.repo to msprod.repo

4. Install the extra packages for enterprise Linux (skipping this step may effect installing libunwind, if the package is not already available)

sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
Install the extra packages for enterprise Linux

5. Install libunwind

sudo yum install libunwind
install libunwind

6. Now install mssql-cli

sudo yum install mssql-cli
install mssql-cli using yum install mssql-cli

7. Verify the installation

mssql-cli --version
check mssql-cli version using mssql-cli --version

Done, latest mssql-cli is now installed.

One thought on “SQL Server command line tools, mssql-cli

Comments are closed.

Back To Top
error: Content is protected !!