Linux

How to install SQL Server 2017 Almalinux

In this quickstart, you install SQL Server 2017 (14.x) on Red Hat Enterprise Linux (RHEL) 8.x. Then you can connect with sqlcmd to create your first database and run queries.

The following commands for installing SQL Server point to the RHEL 8 repository. RHEL 8 doesn't come preinstalled with python2, which is required by SQL Server. Before you begin the SQL Server install steps, execute the command and verify that python2 is selected as the interpreter:

sudo alternatives --config python
# If not configured, install python2 and openssl10 using the following commands:
sudo yum install python2
sudo yum install compat-openssl10
# Configure python2 as the default interpreter using this command:
sudo alternatives --config python

To configure SQL Server on RHEL, run the following commands in a terminal to install the mssql-server package:

Download the SQL Server 2017 (14.x) Red Hat repository configuration file:

sudo curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/8/mssql-server-2017.repo

Run the following command to install SQL Server:

sudo yum install -y mssql-server

After the package installation finishes, run mssql-conf setup using its full path, and follow the prompts to set the SA password and choose your edition. As a reminder, the following SQL Server editions are freely licensed: Evaluation, Developer, and Express.

sudo /opt/mssql/bin/mssql-conf setup

Remember to specify a strong password for the SA account. You need a minimum length 8 characters, including uppercase and lowercase letters, base-10 digits and/or non-alphanumeric symbols.

Once the configuration is done, verify that the service is running:

 systemctl status mssql-server

To allow remote connections, open the SQL Server port on the RHEL firewall. The default SQL Server port is TCP 1433. If you're using FirewallD for your firewall, you can use the following commands:

sudo firewall-cmd --zone=public --add-port=1433/tcp --permanent
sudo firewall-cmd --reload

At this point, SQL Server is running on your RHEL machine and is ready to use!

Thanks for visit my website