Categories
Linux Sql Server

sqlcmd command not found on Ubuntu

sqlcmd command not found on Ubuntu

Hi friends, in this post we will discuss about a error which comes when we installed MSSQL TOOLS on Ubuntu. Error is: sqlcmd command not found on Ubuntu. I installed MSSQL Tools as told by microsoft blog step by step, but sqlcmd is not working and gives error. I googled about this and found a solution on Microsoft blog itself, someone also faced this issue and one of blog member posted this. I have tried and tested it, it’s working fine.

Earlier we had discussed about Install MSSQL Tools on UbuntuInstall SQL Server on UbuntuUnable to lock the administration directory (/var/lib/dpkg/), is another process using it?, and How To Install Linux.

Error:

 sqlcmd command not found on ubuntu

Solution:

Create symbolic link for BCP and SQLCMD. To do this open terminal and run below commands to create symbolic links for BCP and SQLCMD.

sudo ln -sfn /opt/mssql-tools/bin/sqlcmd* /usr/local/bin/sqlcmd 

sudo ln -sfn /opt/mssql-tools/bin/bcp* /usr/local/bin/bcp

sqlcmd : command not found