author | ms.author | ms.date | ms.service | ms.topic | ms.custom | |
---|---|---|---|---|---|---|
rwestMSFT |
randolphwest |
07/22/2024 |
sql |
include |
|
Use the following steps to install the mssql-tools18 on Red Hat Enterprise Linux.
-
Download the Microsoft Red Hat repository configuration file.
-
For Red Hat 9, use the following command:
curl https://packages.microsoft.com/config/rhel/9/prod.repo | sudo tee /etc/yum.repos.d/mssql-release.repo
-
For Red Hat 8, use the following command:
curl https://packages.microsoft.com/config/rhel/8/prod.repo | sudo tee /etc/yum.repos.d/mssql-release.repo
-
For Red Hat 7, use the following command:
curl https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/yum.repos.d/mssql-release.repo
-
-
If you had a previous version of mssql-tools installed, remove any older unixODBC packages.
sudo yum remove mssql-tools unixODBC-utf16 unixODBC-utf16-devel
-
Run the following commands to install mssql-tools18 with the unixODBC developer package.
sudo yum install -y mssql-tools18 unixODBC-devel
To update to the latest version of mssql-tools, run the following commands:
sudo yum check-update sudo yum update mssql-tools18
-
Optional: Add
/opt/mssql-tools18/bin/
to yourPATH
environment variable in a bash shell.To make sqlcmd and bcp accessible from the bash shell for login sessions, modify your
PATH
in the~/.bash_profile
file with the following command:echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bash_profile source ~/.bash_profile
To make sqlcmd and bcp accessible from the bash shell for interactive/non-login sessions, modify the
PATH
in the~/.bashrc
file with the following command:echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrc source ~/.bashrc