---
title: Troubleshoot SQL Server on Linux
description: Troubleshoot Microsoft SQL Server running on Linux or in a Docker container. Learn where to find information about supported features and known limitations.
author: VanMSFT
ms.author: vanto
ms.date: 05/01/2018
ms.topic: troubleshooting
ms.prod: sql
ms.technology: linux
ms.assetid: 99636ee8-2ba6-4316-88e0-121988eebcf9S
---
# Troubleshoot SQL Server on Linux
[!INCLUDE [SQL Server - Linux](../includes/applies-to-version/sql-linux.md)]
This document describes how to troubleshoot Microsoft SQL Server running on Linux or in a Docker container. When troubleshooting SQL Server on Linux, remember to review the supported features and known limitations in the [SQL Server on Linux Release Notes](sql-server-linux-release-notes.md).
> [!TIP]
> For answers to frequently asked questions, see the [SQL Server on Linux FAQ](sql-server-linux-faq.yml).
## Troubleshoot connection failures
If you are having difficulty connecting to your Linux SQL Server, there are a few things to check.
- If you are unable to connect locally using **localhost**, try using the IP address 127.0.0.1 instead. It is possible that **localhost** is not properly mapped to this address.
- Verify that the server name or IP address is reachable from your client machine.
> [!TIP]
> To find the IP address of your Ubuntu machine, you can run the ifconfig command as in the following example:
>
> ```bash
> sudo ifconfig eth0 | grep 'inet addr'
> ```
> For Red Hat, you can use the ip addr as in the following example:
>
> ```bash
> sudo ip addr show eth0 | grep "inet"
> ```
> One exception to this technique relates to Azure VMs. For Azure VMs, [find the public IP for the VM in the Azure portal](/azure/virtual-machines/linux/sql/provision-sql-server-linux-virtual-machine#connect).
- If applicable, check that you have opened the SQL Server port (default 1433) on the firewall.
- For Azure VMs, check that you have a [network security group rule for the default SQL Server port](/azure/virtual-machines/linux/sql/provision-sql-server-linux-virtual-machine#remote).
- Verify that the user name and password do not contain any typos or extra spaces or incorrect casing.
- Try to explicitly set the protocol and port number with the server name like the following example: **tcp:servername,1433**.
- Network connectivity issues can also cause connection errors and timeouts. After verifying your connection information and network connectivity, try the connection again.
## Manage the SQL Server service
The following sections show how to start, stop, restart, and check the status of the SQL Server service.
### Manage the mssql-server service in Red Hat Enterprise Linux (RHEL) and Ubuntu
Check the status of the SQL Server service using this command:
```bash
sudo systemctl status mssql-server
```
You can stop, start, or restart the SQL Server service as needed using the following commands:
```bash
sudo systemctl stop mssql-server
sudo systemctl start mssql-server
sudo systemctl restart mssql-server
```
### Manage the execution of the mssql Docker container
You can get the status and container ID of the latest created SQL Server Docker container by running the following command (The ID is under the **CONTAINER ID** column):
```bash
sudo docker ps -l
```
You can stop or restart the SQL Server service as needed using the following commands:
```bash
sudo docker stop
sudo docker restart
```
> [!TIP]
> For more troubleshooting tips for Docker, see [Troubleshooting SQL Server Docker containers](./sql-server-linux-docker-container-troubleshooting.md).
## Access the log files
The SQL Server engine logs to the /var/opt/mssql/log/errorlog file in both the Linux and Docker installations. You need to be in 'superuser' mode to browse this directory.
The installer logs here: /var/opt/mssql/setup-< time stamp representing time of install>
You can browse the errorlog files with any UTF-16 compatible tool like 'vim' or 'cat' like this:
```bash
sudo cat errorlog
```
If you prefer, you can also convert the files to UTF-8 to read them with 'more' or 'less' with the following command:
```bash
sudo iconv -f UTF-16LE -t UTF-8 -o