Installing Microsoft SQL Server 2019 on Ubuntu 21.04
Step 1: Import Public Repository GPG keys
sudo wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add - |
Step 2: Register Microsoft SQL Server Ubuntu Repository for SQL Server 2019
sudo add-apt-repository “$(wget -qO- https://packages.microsoft.com/config/ubuntu/20.04/mssql-server-2019.list)”
Step 3: Install SQL Server
sudo apt update
sudo apt install -y mssql-server
Step 4: Configure SQL server and give a password
sudo /opt/mssql/bin/mssql-conf setup
Step 5: Start the service
sudo systemctl start mssql-server
Step 6: Check for status
sudo systemctl status mssql-server
Setting up Remote Connection to SQL Server and Connecting to SSMS in Windows
Step 1: Enable port 1433 and 1434 on firewall
sudo ufw enable
sudo ufw allow 1433
sudo ufw allow 1434
Step2: Download SSMS for Windows
https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms?view=sql-server-ver15
Step 3: Connect to Server
Server Type: Database Engine
Server Name: «Computer Name or IP»
Authentication:SQL Server Authentication
Login: SA
Password: *****
Connect and good to go….