# Add Microsoft repository configurations
sudo dnf config-manager addrepo --from-repofile=https://packages.microsoft.com/config/rhel/9/mssql-server-2025.repo
sudo dnf config-manager addrepo --from-repofile=https://packages.microsoft.com/config/rhel/9/prod.repo
# Check for updates and install MS SQL Server and tools
sudo dnf check-update
sudo dnf -y install mssql-server mssql-tools
# Run the setup configuration
sudo /opt/mssql/bin/mssql-conf setup
# Disable the service from starting automatically (if desired)
sudo systemctl disable mssql-server.serviceChoose the block that corresponds to your shell:
For Bash (~/.bashrc):
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
source ~/.bashrcFor Zsh (~/.zshrc):
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.zshrc
source ~/.zshrcFor Fish:
fish_add_path -U /opt/mssql-tools/binsudo /opt/mssql/bin/mssql-conf set-sa-passwordConnect to SQL Server using sqlcmd:
sqlcmd -S localhost -U sa -CRun the following SQL commands:
CREATE LOGIN <user> WITH PASSWORD = '<password>';
gosqlcmd -S localhost -U <user> -C