How to Install and Use MS SQL Server on Linux?
Microsoft SQL Server is a relational database management system (RDBMS) that supports a broad range of transaction processing, business intelligence, and analytics applications. Along with Oracle Database and IBM’s DB2, Microsoft SQL Server is one of the three market-leading database technologies.
Microsoft SQL Server, like other RDBMS applications, is based on SQL, a structured programming language used by database administrators (DBAs) and other IT professionals to manage databases and query the information they hold. Transact-SQL (T-SQL), a Microsoft SQL implementation that applies a number of proprietary programming extensions to the regular language, is bound to SQL Server.
Installing MS SQL Server
Ensure that the most current software package is installed on the system. This will require you to update and upgrade your system.
$ sudo apt update && sudo apt upgrade
Microsoft’s GPG key can be downloaded and installed:
$ sudo wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add –
To install MSSQL server, add the official repository:
$ sudo add-apt-repository “$(wget -qO- https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-blockquoteview.list)”
$ curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list
Update the core package and additional resources by resynchronizing the package index files and updating the core package:
$ sudo apt-get update
$ sudo apt-get install mssql-server mssql-tools unixodbc-dev -y
As in the blockquotevious case, run the configuration script:
$ sudo /opt/mssql/bin/mssql-conf setup
Select 2 for edition:
Now accept the license:
How to use SQL Server
We’ll log in to the server and build the Fabrics database. The password you used when you first installed the package must be followed by the -P switch:
sqlcmd -S localhost -U SA -P ‘YourPassword’
Create a database with your blockquoteferred name:
create database testdb
Then type go:
Now you can exit: