Microsoft SQL Server Linux Red Hat

Deploy Microsoft SQL Server on Linux

Step by step details on how to deploy Microsoft SQL Server on Linux. Includes screenshots from installing SQL Server 2019, and connecting to SQL using MSSQL-CLI.

  1. Connect to your Linux machine. I have Red Hat 8.3 installed.
sql server installation on linux, check linux version

2. As as prerequisite we need to install Python & OpenSSL

sudo yum install python2

I have preinstalled Python

sql server installation on linux install python

3. Lets install OpenSSL

sudo yum install compat-openssl10
sql server installation on linux install openssl

4. Configure python2 as the default interpreter

sudo alternatives --config python
sql server installation on linux set python as the default interpreter

5. Download the SQL Server 2019 Red Hat repo config file.

sudo curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/8/mssql-server-2019.repo
 Download the SQL Server Red Hat repository config file

We are downloading the repo to /etc/yum.repos.d

6. We are now ready to install SQL Server binaries.

sudo yum install -y mssql-server
Install SQL Server on Linux using yum install command

7. Now we can proceed to configure sql server, choose edition & enter sa password

sudo /opt/mssql/bin/mssql-conf setup
configure sql server on linux, choose edition and enter sa password

SQL Server is now configured successfully.

8. Lets proceed to verify the installation

systemctl status mssql-server
verify the installation of sql server on linux using systemctl status mssql-server command

9. We can now connect to the SQL Instance and run few queries to test. Note that am connecting using mssql-cli. To know how to install mssql-cli follow this link – Install mssql-cli on Linux

mssql-cli -S localhost -U sa
	--enter sa password when asked for password
connect to the SQL Server Instance running on linux using mssql-cli

That’s all about installing SQL Server on Red Hat Linux. You may read more posts on itech-blog.com to learn more about SQL Server on Linux and containers.

One thought on “Deploy Microsoft SQL Server on Linux

  1. Deepak kelath says:

    Very good topic

Comments are closed.

Back To Top
error: Content is protected !!