| author | rwestMSFT | |
|---|---|---|
| ms.author | randolphwest | |
| ms.date | 06/28/2024 | |
| ms.service | sql | |
| ms.topic | include | |
| ms.collection |
|
|
| ms.custom |
|
sqlcmd (Go) can be installed cross-platform, on Microsoft Windows, macOS, and Linux. Versions newer than 1.6 might not be available in all package managers. There's no estimated date yet for their availability.
-
Install the Windows Package Manager Client if you don't already have it.
-
Run the following command to install sqlcmd (Go).
winget install sqlcmd
-
Install Chocolatey if you don't already have it.
-
Run the following command to install sqlcmd (Go).
choco install sqlcmd
-
Download the corresponding
-windows-amd64.zipor-windows-arm.zipasset from the latest release of sqlcmd (Go) from the GitHub code repository. -
Extract the
sqlcmd.exefile from the downloaded zip folder.
-
Install Homebrew if you need to.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" -
Install sqlcmd with Homebrew.
brew install sqlcmd
-
Download the
-darwin-amd64.zipasset from the latest release of sqlcmd (Go) from the GitHub code repository. -
Extract the
sqlcmdfile from the downloaded zip folder.
-
Import the public repository GPG keys.
curl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc -
Add the Microsoft repository, where the
ubuntu/20.04segment might bedebian/11,ubuntu/20.04, orubuntu/22.04.add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/20.04/prod.list)" -
Install sqlcmd (Go) with apt.
apt-get update apt-get install sqlcmd
-
Import the Microsoft repository key.
rpm --import https://packages.microsoft.com/keys/microsoft.asc
-
Download the repository configuration file, where the
fedora/32segment might beopensuse/42.3,rhel/8, orsles/15. If the version of your OS doesn't directly correspond to one of those options, you might be able to use a repository configuration file from a version.curl -o /etc/yum.repos.d/packages-microsoft-com-prod.repo https://packages.microsoft.com/config/fedora/40/prod.repo
-
Install sqlcmd (Go) with yum.
yum install sqlcmd
-
Download the corresponding
-linux-x64.tar.bz2or-linux-arm.tar.bz2asset from the latest release of sqlcmd (Go) from the GitHub code repository. -
Extract the
sqlcmdfile from the downloaded zip folder.