| author | rwestMSFT | |
|---|---|---|
| ms.author | randolphwest | |
| ms.date | 07/11/2023 | |
| ms.service | sql | |
| ms.topic | include | |
| ms.custom |
|
Use the following steps to install the mssql-tools18 on Red Hat Enterprise Linux.
-
Enter superuser mode.
sudo su
-
Download the Microsoft Red Hat repository configuration file.
-
For Red Hat 8, use the following command:
curl https://packages.microsoft.com/config/rhel/8/prod.repo > /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 > /etc/yum.repos.d/mssql-release.repo
-
-
Exit superuser mode.
exit -
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
[!NOTE]
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 yourPATHenvironment variable in a bash shell.To make sqlcmd and bcp accessible from the bash shell for login sessions, modify your
PATHin the~/.bash_profilefile with the following command:echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bash_profile
To make sqlcmd and bcp accessible from the bash shell for interactive/non-login sessions, modify the
PATHin the~/.bashrcfile with the following command:echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrc source ~/.bashrc