Install Microsoft SQL Server on Ubuntu


You may not know it, but Microsoft also favors the open source community. The proof is that some Microsoft software is available on Linux, including .NET and SQL. Here Taimienphi.vn will guide you how to install Microsoft SQL Server on Ubuntu.


If your purpose is testing, you can refer to the article How to install Ubuntu in VMware Then perform the steps Install Microsoft SQL Server on Ubuntu below of Taimienphi.vn to ensure that there are no serious problems during the implementation process.

Request

– The device you want to install SQL with minimum RAM of 4GB.
– Your computer must be running Ubuntu 16.04 or 16.10.

SQL installation

Make sure your Ubuntu computer is up to date:

sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade

Then add the SQL repo:

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

Sign up for Microsoft Ubuntu repo:

curl https://packages.microsoft.com/config/ubuntu/16.04/mssql-server.list | sudo tee /etc/apt/sources.list.d/mssql-server.list

Update repo:

sudo apt-get update

SQL installation:

sudo apt-get update

The above command will start installing SQL:

Run the setup command below to finish installing Microsoft SQL Server on Ubuntu:

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

Then press Y to accept the terms agreed.

Next enter your SA account password.

The above operation will complete the installation.

Open port 1433 on the Ubuntu Firewall:

sudo ufw allow 1433

Install microsoft sql server on ubuntu 2

Connect to the server using a command line

To connect to the server using a command line utility, you must have the package mssql-tools. To install the mssql-tools package on Ubuntu, run the following command in the Terminal window:

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

Register the repo with Microsoft:

curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list

Update the source and install the package with the command:

sudo apt-get update && sudo apt-get install mssql-tools unixodbc-dev

More mssql-tools go to the bash path:

echo ‘export PATH = “$ PATH: / opt / mssql-tools / bin”‘ >> – /. bash_profile

echo ‘export PATH = “$ PATH: / opt / mssql-tools / bin”‘ >> – / .bashrc source – /. bashrc

To connect to the database, you use the command:

sqlcmd -S localhost (or the IP address of the server) -U SA

And you will be prompted to enter your SA account password.

To create the database, enter the command:

CREATE DATABASE testdb;

GO

To view the database on the server, enter the command:

SELECT Name from sys.Databases;

GO

To end the session, simply enter QUIT. The syntax is quite similar to MYSQL.

Connect to the server using Microsoft Management Studio

To manage servers on Windows 10 computers, you can use Microsoft Management Studio.

Download Microsoft Management Studio and install it here: Download Microsoft Management Studio

Install microsoft sql server on ubuntu 3

The installation process takes place quickly or slowly depending on the configuration of your computer.

Install microsoft sql server on ubuntu 4

After the installation process has finished, find and open Microsoft SQL Server Management Studio. Import IP address into the frame Ubuntu name, choose SQL Server Authentication from the menu Authentication. Enter your SA account username and password there.

Install microsoft sql server on ubuntu 5

So you are able to connect to the server successfully.

Install microsoft sql server on ubuntu 6

https://thuthuat.taimienphi.vn/cai-dat-microsoft-sql-server-tren-ubuntu-31489n.aspx
Above Taimienphi.vn has shown you how to install Microsoft SQL Server on Ubuntu. In only able to install Microsoft SQL Server but on Ubuntu, you can install other software with just a few simple steps, readers can refer to How to install Java on Ubuntu to know how to install Java better. Any comments, suggestions please leave in the comment section below the article.

.

Add a Comment

Your email address will not be published. Required fields are marked *