Stop MySQL Server

Summary: in this tutorial, you will learn how to stop MySQL Server on Windows and Linux.

Stop MySQL Server on Windows

If you install MySQL Server as a service on Windows, you can stop it as follows:

First, press Windows+R to open the Run dialog.

Second, input cmd and press Ctrl+Shift+Enter to run the Command Prompt as an Administrator.

Third, type the following command to stop the MySQL Server:

net stop mysql

In this command, mysql is the name of the MySQL service. If you use a different service name, you must replace mysql with it.

The command shows the following output:

The MySQL service is stopping.
The MySQL service was stopped successfully.

Stop MySQL Server on Linux

To stop MySQL Server on Linux, you follow these steps:

First, open a Terminal program.

Second, run the following command to stop the MySQL service:

sudo systemctl stop mysql

In this command, you must replace mysql with the actual service name if your MySQL service is different.

To check the status and confirm that the service has stopped, run the following command:

sudo systemctl status mysql

If you have stopped the service successfully, you should see “Active: inactive (dead)“.

Summary

  • Use the net stop <mysql_service> command to stop MySQL server on Windows.
  • Use the sudo systemctl stop mysqld command to stop the MySQL server on Linux.
Was this tutorial helpful?