Installing sqlcmd on Linux

Installing sqlcmd for accessing SQL Server from a Linux machine

Amazon Linux

Import the Microsoft GPG keys

sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc

Add the Microsoft SQL Server Tools repository

sudo curl -o /etc/yum.repos.d/mssql-tools.repo https://packages.microsoft.com/config/rhel/7/prod.repo

Install Command

sudo yum update -y

sudo ACCEPT_EULA=Y yum install -y mssql-tools unixODBC-devel

echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile
source ~/.bash_profile

Last updated

Was this helpful?