Hey @Kavita, follow these steps to install MS SQL on ubuntu
Execute these commands:
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
curl https://packages.microsoft.com/config/ubuntu/16.04/mssql-server.list | sudo tee /etc/apt/sources.list.d/mssql-server.list
sudo apt-get update
sudo apt-get install -y mssql-server
Configure ms-sql
sudo /opt/mssql/bin/mssql-conf setup
Start ms-sql
systemctl status mssql-server
sudo apt-get update
Install ms-sql tools
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add –
curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list
sudo apt-get update
sudo apt-get install mssql-tools unixodbc-dev
Press yes and continue
Accept the license by clicking yes
Configure the authentication by clicking on yes
Add PATH environment variable to bash
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile
ls /opt/mssql-tools/bin/sqlcmd*
Create a link
ln -sfn /opt/mssql-tools/bin/sqlcmd /usr/bin/sqlcmd
sudo ufw allow 1433/tcp
sudo service network-manager restart
Login to the server
sqlcmd -S localhost -U SA
Execute following SQL
SELECT @@VERSION
2> GO
If you need to know more about MS SQL, it is recommended to go for the SQL Certification Course today.