Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Permalink
live
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
title description author ms.author ms.reviewer ms.date ms.service ms.subservice ms.topic ms.custom
SUSE: Install SQL Server on Linux
This quickstart shows how to install SQL Server on SUSE Linux Enterprise Server and then create and query a database with sqlcmd.
VanMSFT
vanto
randolphwest
01/23/2023
sql
linux
conceptual
intro-installation

Quickstart: Install SQL Server and create a database on SUSE Linux Enterprise Server

[!INCLUDE SQL Server - Linux]

::: moniker range="= sql-server-linux-2017 || = sql-server-2017"

In this quickstart, you install [!INCLUDE sssql17-md] on SUSE Linux Enterprise Server (SLES) v12. Then you can connect with sqlcmd to create your first database and run queries.

For more information on supported platforms, see Release notes for SQL Server 2017 on Linux.

::: moniker-end

::: moniker range=">= sql-server-linux-ver15 || >= sql-server-ver15"

In this quickstart, you install [!INCLUDE sssql19-md] on SUSE Linux Enterprise Server (SLES) v15 (SP3). Then you can connect with sqlcmd to create your first database and run queries.

For more information on supported platforms, see Release notes for SQL Server 2019 on Linux.

::: moniker-end

::: moniker range=">= sql-server-linux-ver16 || >= sql-server-ver16"

In this quickstart, you install [!INCLUDE sssql22-md] on SUSE Linux Enterprise Server (SLES) v15 (SP3). Then you can connect with sqlcmd to create your first database and run queries.

For more information on supported platforms, see Release notes for SQL Server 2022 on Linux.

::: moniker-end

[!TIP]
This tutorial requires user input and an internet connection. If you are interested in the unattended or offline installation procedures, see Installation guidance for SQL Server on Linux.

Prerequisites

::: moniker range="= sql-server-linux-2017 || = sql-server-2017"

You must have a SLES v12 SP5 machine with at least 2 GB of memory. The file system must be XFS or EXT4. Other file systems, such as BTRFS, are unsupported.

::: moniker-end

::: moniker range="= sql-server-linux-ver15 || = sql-server-ver15"

You must have a SLES v15 (SP1 - SP3) machine with at least 2 GB of memory. The file system must be XFS or EXT4. Other file systems, such as BTRFS, are unsupported.

::: moniker-end

::: moniker range=">= sql-server-linux-ver16 || >= sql-server-ver16"

You must have a SLES v15 (SP1 - SP3) machine with at least 2 GB of memory. The file system must be XFS or EXT4. Other file systems, such as BTRFS, are unsupported.

::: moniker-end

To install SUSE Linux Enterprise Server on your own machine, go to https://www.suse.com/products/server. You can also create SLES virtual machines in Azure. See Create and Manage Linux VMs with the Azure CLI, and use --image SLES in the call to az vm create.

If you've previously installed a community technology preview (CTP) or release candidate (RC) of [!INCLUDE ssnoversion-md], you must first remove the old repository before following these steps. For more information, see Configure Linux repositories for SQL Server.

[!NOTE]
At this time, the Windows Subsystem for Linux for Windows 10 or Windows 11 is not supported as an installation target.

For other system requirements, see System requirements for SQL Server on Linux.

Install SQL Server

To configure [!INCLUDE ssnoversion-md] on SLES, run the following commands in a terminal to install the mssql-server package:

::: moniker range="= sql-server-linux-2017 || = sql-server-2017"

  1. Download the [!INCLUDE sssql17-md] SLES repository configuration file:

    sudo zypper addrepo -fc https://packages.microsoft.com/config/sles/12/mssql-server-2017.repo

    [!TIP]
    If you want to install a different version of [!INCLUDE ssnoversion-md], see the [[!INCLUDE sssql19-md]](quickstart-install-connect-suse.md?view=sql-server-linux-ver15&preserve-view=true#install) or [[!INCLUDE sssql22-md]](quickstart-install-connect-suse.md?view=sql-server-linux-ver16&preserve-view=true#install) version of this article.

  2. Refresh your repositories.

    sudo zypper --gpg-auto-import-keys refresh

    To ensure that the Microsoft package signing key is installed on your system, you can import it using the command below:

    sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
  3. Before you install [!INCLUDE ssnoversion-md], and after you have registered and activated your SUSE Linux Enterprise Server with SUSE Customer Center, you must activate both the Desktop Applications module and Development Tools module. These modules are required for some of the [!INCLUDE ssnoversion-md] package dependencies.

  4. Now, you are ready to install [!INCLUDE ssnoversion-md]. Run the following commands to install [!INCLUDE ssnoversion-md]:

    sudo zypper install -y mssql-server
  5. After the package installation finishes, run mssql-conf setup and follow the prompts to set the SA password and choose your edition. As a reminder, the following [!INCLUDE ssnoversion-md] editions are freely licensed: Evaluation, Developer, and Express.

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

    Remember to specify a strong password for the SA account. You need a minimum length 8 characters, including uppercase and lowercase letters, base-10 digits and/or non-alphanumeric symbols.

  6. Once the configuration is done, verify that the service is running:

    systemctl status mssql-server
  7. If you plan to connect remotely, you might also need to open the [!INCLUDE ssnoversion-md] TCP port (default 1433) on your firewall. If you're using the SuSE firewall, you need to edit the /etc/sysconfig/SuSEfirewall2 configuration file. Modify the FW_SERVICES_EXT_TCP entry to include the [!INCLUDE ssnoversion-md] port number.

    FW_SERVICES_EXT_TCP="1433"

At this point, [!INCLUDE ssnoversion-md] is running on your SLES machine and is ready to use!

::: moniker-end

::: moniker range="= sql-server-linux-ver15 || = sql-server-ver15"

  1. Download the [!INCLUDE sssql19-md] SLES repository configuration file:

    sudo zypper addrepo -fc https://packages.microsoft.com/config/sles/15/mssql-server-2019.repo

    [!WARNING]
    SUSE Linux Enterprise Server (SLES) is not a supported platform for the Community Technology Preview (CTP) 2.1 release of [!INCLUDEsssql22]. You won't be able to install [!INCLUDEsssql22].

    [!TIP]
    If you want to install a different version of [!INCLUDE ssnoversion-md], see the [[!INCLUDE sssql17-md]](quickstart-install-connect-suse.md?view=sql-server-linux-2017&preserve-view=true#install) or [[!INCLUDE sssql22-md]](quickstart-install-connect-suse.md?view=sql-server-linux-ver16&preserve-view=true#install) version of this article.

  2. Refresh your repositories.

    sudo zypper --gpg-auto-import-keys refresh

    To ensure that the Microsoft package signing key is installed on your system, you can import it using the command below:

    sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
  3. Before you install [!INCLUDE ssnoversion-md], and after you have registered and activated your SUSE Linux Enterprise Server with SUSE Customer Center, you must activate both the Desktop Applications module and Development Tools module. These modules are required for some of the [!INCLUDE ssnoversion-md] package dependencies.

  4. Now, you are ready to install [!INCLUDE ssnoversion-md]. Run the following commands to install [!INCLUDE ssnoversion-md]:

    sudo zypper install -y mssql-server
  5. After the package installation finishes, run mssql-conf setup and follow the prompts to set the SA password and choose your edition. As a reminder, the following [!INCLUDE ssnoversion-md] editions are freely licensed: Evaluation, Developer, and Express.

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

    Remember to specify a strong password for the SA account. You need a minimum length 8 characters, including uppercase and lowercase letters, base-10 digits and/or non-alphanumeric symbols.

  6. Once the configuration is done, verify that the service is running:

    systemctl status mssql-server
  7. If you plan to connect remotely, you might need to open the [!INCLUDE ssnoversion-md] TCP port (default 1433) on your firewall.

    [!NOTE]
    On SLES, you can manage your firewall using firewalld for example. Install it using sudo zypper install firewalld, and then start it up with sudo systemctl start firewalld. Add the firewall rule with sudo firewall-cmd --zone=public --add-port=1433/tcp --permanent, and then reload the firewall with sudo firewall-cmd --reload for the settings to take effect.

At this point, [!INCLUDE ssnoversion-md] is running on your SLES machine and is ready to use!

::: moniker-end

::: moniker range=">= sql-server-linux-ver16 || >= sql-server-ver16"

  1. Download the [!INCLUDE sssql22-md] SLES repository configuration file:

    sudo zypper addrepo -fc https://packages.microsoft.com/config/sles/15/mssql-server-2022.repo

    [!TIP]
    If you want to install a different version of [!INCLUDE ssnoversion-md], see the [[!INCLUDE sssql17-md]](quickstart-install-connect-suse.md?view=sql-server-linux-2017&preserve-view=true#install) or [[!INCLUDE sssql19-md]](quickstart-install-connect-suse.md?view=sql-server-linux-ver15&preserve-view=true#install) version of this article.

  2. Refresh your repositories.

    sudo zypper --gpg-auto-import-keys refresh

    To ensure that the Microsoft package signing key is installed on your system, you can import it using the command below:

    sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
  3. Before you install [!INCLUDE ssnoversion-md], and after you have registered and activated your SUSE Linux Enterprise Server with SUSE Customer Center, you must activate both the Desktop Applications module and Development Tools module. These modules are required for some of the [!INCLUDE ssnoversion-md] package dependencies.

  4. Now, you are ready to install [!INCLUDE ssnoversion-md]. Run the following commands to install [!INCLUDE ssnoversion-md]:

    sudo zypper install -y mssql-server
  5. After the package installation finishes, run mssql-conf setup and follow the prompts to set the SA password and choose your edition. As a reminder, the following [!INCLUDE ssnoversion-md] editions are freely licensed: Evaluation, Developer, and Express.

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

    Remember to specify a strong password for the SA account. You need a minimum length 8 characters, including uppercase and lowercase letters, base-10 digits and/or non-alphanumeric symbols.

  6. Once the configuration is done, verify that the service is running:

    systemctl status mssql-server
  7. If you plan to connect remotely, you might need to open the [!INCLUDE ssnoversion-md] TCP port (default 1433) on your firewall.

    [!NOTE]
    On SLES, you can manage your firewall using firewalld for example. Install it using sudo zypper install firewalld, and then start it up with sudo systemctl start firewalld. Add the firewall rule with sudo firewall-cmd --zone=public --add-port=1433/tcp --permanent, and then reload the firewall with sudo firewall-cmd --reload for the settings to take effect.

At this point, [!INCLUDE ssnoversion-md] is running on your SLES machine and is ready to use!

::: moniker-end

Install the SQL Server command-line tools

To create a database, you need to connect with a tool that can run Transact-SQL statements on [!INCLUDE ssnoversion-md]. The following steps install the [!INCLUDE ssnoversion-md] command-line tools: sqlcmd and bcp.

  1. Add the [!INCLUDE ssnoversion-md] repository to Zypper.

    sudo zypper addrepo -fc https://packages.microsoft.com/config/sles/15/prod.repo
    sudo zypper --gpg-auto-import-keys refresh
  2. Install mssql-tools with the unixODBC developer package. For more information, see Install the Microsoft ODBC driver for SQL Server (Linux).

    sudo zypper install -y mssql-tools unixODBC-devel
  3. For convenience, add /opt/mssql-tools/bin/ to your PATH environment variable, to make sqlcmd or bcp accessible from the bash shell.

    For interactive sessions, modify the PATH environment variable in your ~/.bash_profile file with the following command:

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

    For non-interactive sessions, modify the PATH environment variable in your ~/.bashrc file with the following command:

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

[!INCLUDE Connect, create, and query data]