Menu & Search
Check & Restart SQL Server Services on Linux

Check & Restart SQL Server Services on Linux

Restarting services is a simple one, although it could be an unfamiliar environment for pre-SQL Server 2017 (only) administrators; which was the edition that allowed SQL Server to run on Linux.

General information regarding restarting the SQL Server services can be found on this Microsoft Docs page.

Each of the following areas utilises the systemctl command:
# Show All Enabled Services.
# Check the Status of the SQL Server Service.
# Stop/Start/Restart SQL Server Services.

Show All Enabled Services

systemctl list-unit-files | grep enabled
Linux systemctl list-unit-files

If your service is not on the above list, it won’t start on the next reboot. View the full by entering the ‘systemctl’ command on it’s own, and enable/disable by replacing ‘start/restart’ with ‘enable/disable’ – more info in systemctl link above. 

Check the Status of the SQL Server Service

sudo systemctl status mssql-server

Green-text will show you the service is currently active.

Stop/Start/Restart the SQL Server Services

Stop/Start services if you need it down for a while or just run a restart.

Start / Stop:

sudo systemctl stop mssql-server
sudo systemctl start mssqsl-server


sudo systemctl restart mssqsl-server

Always a status check at the end to verify (get used to writing it).