How to Install SQL Server Express in Linux?
Last Updated :
22 Mar, 2022
Microsoft SQL Server Express is a feature-limited edition of Microsoft's SQL Server relational database management which is free to download, distribute, and use. It is used for creating or developing small-scale applications. It has been published since the SQL Server 2005. Microsoft provides it for educational purposes. This edition is used by Students, hobbyists, and startups to develop projects that do not require advanced features of SQL Server. It can also be used for any production database that is sized at or below the current SQL server. It has 10 GB of maximum database size and other important limits. In this article, we will learn how to install SQL Server Express in Linux.
Installing SQL Server Express in Linux
Follow the below steps to install SQL Server Express on ubuntu:
Step 1: Import the public repository GPG keys:
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -

Step 2: Add MS-SQL Server repository:
sudo add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/20.04/mssql-server-2019.list)"

Step 3: Install the Server using the following commands.
sudo apt update && sudo apt install -y mssql-server

Installing required packages...

Step 4: Configure the Server using the following command:
sudo /opt/mssql/bin/mssql-conf setup
While configuring the Server, choose " 3 " to install SQL Express Server as shown below and set up an administrator password.

Step 5: Verify that the server is running:

Step 6: Install the SQL Server command-line tools. So first we add tools repository using the following command:
curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list

Now Install the required CLI tools:
sudo apt update && sudo apt install -y mssql-tools unixodbc-dev

Now we make a symbolic link of sqlcmd in /usr/local/bin :
sudo ln -s /opt/mssql-tools/bin/sqlcmd /usr/local/bin

At this point your installation is successful.
Create a new Database
Step 1: Connect locally to your MS SQL Express Server as the user SA:
sqlcmd -S localhost -U SA

Step 2: Create a database:
CREATE DATABASE <database name>
GO

Step 3: Verify the database creation:
SELECT name FROM sys.databases
GO

Note: To execute a command properly or commit a transaction, you must type GO on a new line to execute previous commands.
Similar Reads
How to Install SQL Express Server on Windows? Downloading and installation of SQL Express Server is an easy process, but first, let us understand what is SQL Server Express, then we will see the download and installation process of SQL server express. SQL Express Server SQL Express Server is a free Microsoft database edition. It is a version of
4 min read
How to install SQL Server Agent on Linux? SQL Server Agent is a Microsoft Windows service that runs SQL Server jobs, which are scheduled administration activities. SQL Server Agent stores job information in SQL Server. One or more job steps can be found in a job. Each phase has its own set of tasks, such as backing up a database. Installing
2 min read
How to Install SQL Developer in Linux? SQL Developer is a client application or a desktop application. We can install it in our local system & can access Oracle Database. Oracle provides it. Oracle has a server component & SQL Developer has a client component. By using SQL developer we can access the Oracle database. SQL Developm
3 min read
How to Install SQL Client in Linux? The installation of MySQL client on Linux systems allows plenty possibilities to connect, manage and interact with MySQL databases straight from terminal. Whether itâs for Developers, Database Administrators or System Users, efficiently querying and managing databases requires setting up MySQL clien
3 min read
How to Install SQL Server on Azure VM? Microsoft Azure provides us with multiple database services which help us to run popular relational database management systems, like MySQL, SQL Server, and PostgreSQL in the cloud. We can use an SQL server on Azure Virtual machines by running a virtual machine in Azure and installing an SQL server
5 min read