Tutorial to install MSSQL Server 2022 on Redhat 9 / Rocky Linux 9 / CentOS Stream 9 / Alma Linux 9
summarized from https://learn.microsoft.com/en-us/sql/linux/quickstart-install-connect-red-hat?view=sql-server-linux-ver16&preserve-view=true&tabs=rhel9#install
watch the tutorial here: https://www.youtube.com/watch?v=65SapmB-De0
sudo curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/9/mssql-server-2022.repo
sudo curl https://packages.microsoft.com/config/rhel/9/prod.repo | sudo tee /etc/yum.repos.d/mssql-release.repo
(Must choose with selinux or not! check with getenforce
at terminal)
with selinux status at gentenforce : Enforcing
sudo yum install -y mssql-server-selinux
OR
with selinux status at gentenforce : Permissive or Disabled
sudo yum install -y mssql-server
sudo yum install -y mssql-tools
sudo yum install -y unixODBC-devel
Choose Edition, Accept License Terms, Create sa (the system administator) password
sudo /opt/mssql/bin/mssql-conf setup
then check after installed
sudo systemctl status mssql-server
sudo firewall-cmd --zone=public --add-port=1433/tcp --permanent
sudo firewall-cmd --reload
(optional - for scheduling within MS SQL Server, not available for Express Editions)
sudo /opt/mssql/bin/mssql-conf set sqlagent.enabled true
then check after setup
sudo systemctl status mssql-server
(optional - for advanced search text in query, available on Express Edition with Advanced Service and above.)
add the repo, if you have already add the repo no.2 above, you don't need to run this again, just go to download and install below
sudo curl https://packages.microsoft.com/config/rhel/9/prod.repo | sudo tee /etc/yum.repos.d/mssql-release.repo
download and install:
sudo yum install -y mssql-server-fts
then check after installed
sudo systemctl restart mssql-server
script to check within SQL Server Client
SELECT
CASE
WHEN
FULLTEXTSERVICEPROPERTY('IsFullTextInstalled') = 1
THEN
'INSTALLED'
ELSE
'NOT INSTALLED'
END IsFullTextInstalled
Windows OS GUI Client, open and download link: https://aka.ms/ssmsfullsetup then follow the instruction
Linux OS Client with GUI, use Redhat .rpm file, open and find the download link at: https://learn.microsoft.com/en-us/azure-data-studio/download-azure-data-studio
then install:
sudo yum install ./Downloads/azuredatastudio-linux-<version string>.rpm
after installation, run Azure Data Studio by typing at the terminal:
azuredatastudio
- MS SQL Server 2022 Editions comparison: https://learn.microsoft.com/en-us/sql/sql-server/editions-and-components-of-sql-server-2022?view=sql-server-ver16
- CLI Tools, sqlcmd : https://learn.microsoft.com/en-us/sql/tools/sqlcmd/sqlcmd-utility?view=sql-server-ver16&tabs=go%2Cwindows&pivots=cs1-bash
- Sample MS SQL Server database AdventureWorks : https://learn.microsoft.com/en-us/sql/samples/adventureworks-install-configure?view=sql-server-ver16&tabs=ssms