<mohammadrony>

Database Server Setup

Windows

Install Package

  • Download MSSQL developer version
  • Start SQL...-Dev.exe file > Select Basic > Install

Open Database Port

Enable connecting ip address

  • Start Menu > SQL Server Configuration Manager
  • SQL Server Network Configuration > Protocols for MSSQLSERVER > Enable TCP/IP Protocol
  • SQL Server Services > SQL Server > Restart Service

Create firewall rule

  • Open Windows Firewall > Advanced Settings > Inbound Rules
  • New Rule to allow TCP Port 1433

Enable user authentication

  • Start Menu > Open SSMS > Server Properties > Security
  • SQL Server and Windows Authentication mode (Enable)
  • Server Properties > Connections > Allow Remote Connections
  • Security > Create login > User Mapping > Permissions

Ubuntu

SQL Server Quickstart

Add repository

curl -fsSL https://packages.microsoft.com/keys/microsoft.asc | sudo gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg
curl -fsSL https://packages.microsoft.com/config/ubuntu/22.04/mssql-server-2022.list | sudo tee /etc/apt/sources.list.d/mssql-server-2022.list
# Ubuntu 24
curl -LO http://archive.ubuntu.com/ubuntu/pool/main/o/openldap/libldap-2.5-0_2.5.18+dfsg-0ubuntu0.22.04.1_amd64.deb
sudo apt install -y ./libldap-2.5-0_2.5.18+dfsg-0ubuntu0.22.04.1_amd64.deb

Install mssql server

sudo apt update
sudo apt install -y mssql-server

Configure sa user

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

# Enter your edition(1-10):
# Do you accept the license terms? [Yes/No]:
# Enter the SQL Server system administrator password:
# Confirm the SQL Server system administrator password:

Restart service

sudo systemctl status mssql-server

Check version

dpkg -l | grep -i mssql-server

Disable the sa account as a best practice