By: Rajendra Gupta | Updated: 2017-02-27 | Comments (1) | Related: > SQL Server on Linux
Problem
Microsoft has recently released SQL Server to run on Linux servers. Once installed, we may need to stop, start, enable or disable the services. In this tip we will see how to do it in Linux.
Solution
In the previous tip, Installing SQL Server vNext CTP1 on Red Hat Linux 7.2, we saw how to install SQL Server on Redhat Linux. Now let's explore how to perform operations for SQL Server services.
Check the status of SQL Server Services
Once we have SQL Server installed, we can check the service status using the below command.
#check the status of mssql-server service. systemctl status mssql-server
We can see the service status is Active (Running) that means the SQL Service is running fine.
Stop the SQL Server Services
To stop the SQL Server services we need to run the below command.
#Stop mssql-server service. sudo systemctl stop mssql-server
Once the services are stopped, we can check the status using the previous command.
We can now see that the service status has changed to Failed, since the SQL Server services are in a stopped status.
Start the SQL Server Services
To start SQL Server services we need to run the below command.
#Start mssql-server service. sudo systemctl Start mssql-server
Now check the status of SQL services and we can see it is running again.
Stop and Disable the SQL Server Services
To stop and disable the SQL Server services run the below commands.
#Stop and Disable mssql-server service. sudo systemctl stop mssql-server sudo systemctl disable mssql-server
Verify the status of SQL Server services.
Now the status of the service has changed to Disabled as highlighted above.
Enable and Start the SQL Server Services
To enable and start the SQL Server services run the below commands.
#Enable and start mssql-server service. sudo systemctl enable mssql-server sudo systemctl start mssql-server
Again we can verify the status of SQL Server services.
Next Steps
- Explore SQL Server on Linux and perform these operations for basic administration purpose.
- Read more SQL Server on Linux Tips.
About the author
This author pledges the content of this article is based on professional experience and not AI generated.
View all my tips
Article Last Updated: 2017-02-27