| title | Install SQL Server on Ubuntu - SQL Server vNext CTP1 | Microsoft Docs |
|---|---|
| description | |
| author | rothja |
| ms.author | jroth |
| manager | jhubbard |
| ms.date | 11/15/2016 |
| ms.topic | article |
| ms.prod | sql-linux |
| ms.technology | database-engine |
| ms.assetid | 31c8c92e-12fe-4728-9b95-4bc028250d85 |
This topic provides a walkthrough of how to install SQL Server vNext CTP1 on Ubuntu 16.04.
To install the mssql-server Package on Ubuntu, follow these steps:
-
Enter superuser mode.
$ sudo su -
Import the public repository GPG keys:
# curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - -
Register the Microsoft SQL Server Ubuntu repository:
# echo "deb [arch=amd64] https://packages.microsoft.com/ubuntu/16.04/mssql-server xenial main" > /etc/apt/sources.list.d/mssql-server.list -
Exit superuser mode.
# exit -
Run the following commands to install SQL Server:
$ sudo apt-get update $ sudo apt-get install -y mssql-server -
After the package installation finishes, run the configuration script and follow the prompts to accept the End-User License Agreement, set the initial password, enable the service and confirm if the service is going to run on boot:
$ sudo /opt/mssql/bin/sqlservr-setup -
Once the configuration is done, verify that the service is running:
$ systemctl status mssql-server
Use the following command to print the installed package name and version:
$ dpkg-query -W | grep mssql
The following steps installs the command-line tools, Microsoft ODBC drivers, and their dependencies. For the details on what gets installed, see Command-line tools and ODBC drivers.
-
Enter superuser mode.
$ sudo su -
Register the mssql-tools repository: # echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/mssql-ubuntu-xenial-release/ xenial main" > /etc/apt/sources.list.d/mssqlpreview.list
-
Exit superuser mode:
# exit -
Import the mssql-tools repository GPG keys:
$ sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893 -
Update the sources list and run the installation command:
$ sudo apt-get update $ sudo apt-get install mssql-tools
If you are install these packages from the same Linux machine as your SQL Server installation, you can run a test by connecting to your local SQL Server instance (localhost) with your SA username and password:
$ sqlcmd -S localhost -U SA -P <password>
Type exit to return to the command-line.
After installation, connect to the SQL Server instance to create and manage databases. To get started, see Connect and query SQL Server on Linux.