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 (184.108.40.206-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:
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.
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