To install SQL Server on Ubuntu 18.04 or 20.04, you will need to follow these steps:
- Import the Microsoft GPG key using the following command:
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
- Register the Microsoft SQL Server Ubuntu repository:
sudo add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/18.04/mssql-server-2019.list)"
Note: If you are using Ubuntu 20.04, you will need to use the following repository instead:
sudo add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/20.04/mssql-server-2019.list)"
- Update the package cache and install SQL Server:
sudo apt-get update sudo apt-get install -y mssql-server
- Once the installation is complete, run the following command to configure your SQL Server instance:
sudo /opt/mssql/bin/mssql-conf setup
Follow the prompts to set the SA password and choose your SQL Server edition.
Once the configuration is complete, start the SQL Server service using the following command:
sudo systemctl start mssql-server
You should now be able to connect to your SQL Server instance from your application. To confirm that SQL Server is running, you can use the following command:
systemctl status mssql-server
I hope this helps! Let me know if you have any questions.
Thanks for reading...