Sunday, July 22, 2018

Installation of SQL Server in Ubuntu 18.04 Linux Platform




Please install Oracle virtual Machine in your laptop . Please follow the below link to install Ubuntu 18.04 in your virtual machine. 






Please follow the below steps to install SQL Server in Ubuntu 18.04



Step 1:

wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add –






Step 2:







Step 3:
sudo apt-get update
sudo apt-get install -y mssql-server


Once you run this command you will get an error for downgrading openssl. You must downgrade openssl prior to 1.1.0 and then only you can install sql server in Ubuntu 18.04. Please check the below screen shot.




The steps after the openssl error

Step 4:

apt-get install -y libjemalloc1 libsss-nss-idmap0 libc++1 gawk curl




Step 5 :

curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -




Step 6 :

add-apt-repository "$(curl https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-2017.list)"






Step 7:





Step 8:




Step 9 :

dpkg -i ca-certificates_20160104ubuntu1_all.deb




Step 10:

wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/openssl_1.0.2g-1ubuntu4_amd64.deb



Step 11

dpkg -i openssl_1.0.2g-1ubuntu4_amd64.deb




Step 12:

apt install -y libcurl3




Step 13:

apt-get update
apt-get install -y mssql-server




Step 14:

After the package installation finishes, run mssql-conf setup and follow the prompts to set the SA password and choose your edition.

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






Step 15 : To chek SQL Server service is started or not

Systemctl status mssql-server





Step 16: 

Sudo apt-get install mssql-tools




Step 17 :


Bash path settings for SQLCMD tool

echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile

echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
source ~/.bashrc






Step 18 :

Login to SQL Server using SQLCMD

Command : 

sqlcmd -S localhost -U SA -P





  Step 19: 

Active firewall and open port 1433 for communicating with application

command : sudo ufw enable 




Step 20: 

Sudo ufw allow 1433



No comments:

Post a Comment