By: Rajendra Gupta | Last Updated: 2017-02-27 | Comments (1) | SQL Server on Linux
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.
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.
- Explore SQL Server on Linux and perform these operations for basic administration purpose.
- Read more SQL Server on Linux Tips.
Last Updated: 2017-02-27
About the author
View all my tips