SQL Server 2019 is a powerful relational database management system that can be installed on both Windows and Linux operating systems. In this article, we will guide you through the process of installing SQL Server 2019 on RedHat Linux.
Step 1: Prepare a Virtual Machine for RedHat Linux
To begin, you will need to create a virtual machine using virtualization software such as Oracle VirtualBox. Download and install the latest version of VirtualBox on your machine. Once installed, create a new virtual machine and specify a name, folder, and operating system type (Linux) and version (Red-Hat). Allocate an appropriate amount of memory for the virtual machine and create a virtual hard disk. Download the ISO file for RedHat Linux 18 and start the virtual machine using the ISO file.
Step 2: Install Python2 and OpenSSL
SQL Server 2019 uses Python and OpenSSL for the installation process. Install Python2 on RedHat Enterprise Linux by running the following command in the terminal:
$ sudo yum install python2Once Python2 is installed, you can install OpenSSL using the following command:
$ sudo yum install compat-openssl10Set Python2 as the default interpreter for SQL Server 2019 by running the following command:
$ sudo alternatives --config pythonStep 3: Download and Install SQL Server 2019
Download the SQL Server 2019 Red Hat repository configuration file using the CURL command:
$ sudo curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/8/mssql-server-2019.repoInstall SQL Server 2019 from the repository using the following command:
$ sudo yum install -y mssql-serverConfigure SQL Server 2019 using the mssql-conf utility:
$ sudo /opt/mssql/bin/mssql-conf setupFollow the prompts to select the edition of SQL Server, set the SA password, and accept the license terms. Once the configuration is complete, SQL Server 2019 will be installed and the services will start running.
Step 4: Install SQL Server Command-Line Tools
To connect to SQL Server on Linux, you can use various tools such as SQL Server Management Studio, Azure Data Studio, or SQLCMD. To install SQLCMD, download the SQL Server 2019 Red Hat repository configuration file:
$ sudo curl -o /etc/yum.repos.d/msprod.repo https://packages.microsoft.com/config/rhel/8/prod.repoInstall the mssql-tools and unixODBC developer package:
$ sudo yum install -y mssql-tools unixODBC-develAdd the client tools path to the PATH environment variable:
$ echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile
$ echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
$ source ~/.bashrcYou can now connect to SQL Server 2019 using SQLCMD:
$ sqlcmd -s localhost -U SA -P [password]Step 5: Install Azure Data Studio
Azure Data Studio is a cross-platform database tool that you can use to connect to SQL Server on Linux. Download the Linux version of Azure Data Studio from the Microsoft Docs website and install it on your RedHat Linux machine. Launch Azure Data Studio and specify the server name, authentication type, and credentials to connect to SQL Server.
Conclusion
In this article, we have walked you through the process of installing SQL Server 2019 on RedHat Linux. By following these steps, you can set up a powerful relational database management system on your Linux machine and start executing SQL queries using tools like SQLCMD and Azure Data Studio.