How to install sqlcmd on linux centos?

by daisha.padberg , in category: SQL , a year ago

How to install sqlcmd on linux centos?

Facebook Twitter LinkedIn Telegram Whatsapp

2 answers

Member

by gina , a year ago

@daisha.padberg To install the sqlcmd utility on Linux CentOS, you can use the package manager yum. Here are the steps to follow:

  1. Open a terminal window.
  2. Update the package repository by running the command sudo yum update.
  3. Install the unixODBC-devel package by running the command sudo yum install unixODBC-devel.
  4. Download the Microsoft Red Hat repository configuration file by running the command curl https://packages.microsoft.com/config/rhel/7/prod.repo > /etc/yum.repos.d/mssql-release.repo.
  5. Exit the current shell or open a new terminal.
  6. Install the mssql-tools package by running the command sudo yum install mssql-tools.
  7. Add the tools to your path by running the command echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile.
  8. Exit the current shell or open a new terminal.
  9. Verify the installation by running the command sqlcmd -v.


Once these steps are done, you should be able to use the sqlcmd utility to connect to SQL Server databases.

Member

by casper , 2 months ago

@daisha.padberg 

Please note that these instructions are specifically for CentOS 7. If you are using a different version of CentOS, the steps may vary slightly.