Error resolved "sqlcmd: command not found."
After installing MS SQL server on your local machine, you might want to connect with MS SQL server with command line.
sqlcmd -S localhost -U sa -P "<password>"
But instead of connecting with MS SQL server, you might get the error "sqlcmd: command not found."
There might be mssql-tools or symlink issue. To resolve this error, use below commands.
The first method you should try is check mssql-tools is installed. Run the below command in Terminal.
sudo apt-get install mssql-tools
If mssql-tools is already installed, you might get below output.
Reading package lists... Done Building dependency tree Reading state information... Done mssql-tools is already the newest version (17.7.1.1-1). 0 upgraded, 0 newly installed, 0 to remove and 7 not upgraded.
If it is not already installed, it will start installing. You might still get the error after installation complete. You need to create symlinks. Run the below command to check where mssql-tools/bin/sqlcmd is installed.
sudo ls /opt/mssql-tools/bin/sqlcmd*
It will output the path something like:
/opt/mssql-tools/bin/sqlcmd
Now create symlink of the command to /user/bin folder with below command.
sudo ln -sfn /opt/mssql-tools/bin/sqlcmd /usr/bin/sqlcmd
This option should fix the error and you can now access MS SQL server using that above command.
Divyang Vadodariya
My name is Divyang Vadodariya. I'm a full-stack developer, entrepreneur and owner of RvSolutionStuff. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Javascript, JQuery, Laravel, Codeigniter, VueJS, AngularJS and Bootstrap ,etc from the early stage.

We are Recommending you
- Carbon - How to Check If Date Is Past Date In Laravel 8 ?
- How To Install Bootstrap In Angular Example
- Create soft-UI css code using Neumorphism/Soft UI Example
- Create Animation Effects Using Pure CSS Example
- How to disable text selection on HTML web pages using jQuery and CSS
- Python Get Current Date Minus 1 Day Example
- What Is Content Spoofing And How To Prevent It
- How To Set CORS In Nginx Server
- How To Create And Setup Symfony Project
- Error resolved "sqlcmd: command not found."
Copyright © 2023 www.RVSolutionStuff.com • All Rights Reserved