Stop MySQL Server on Linux

To stop MySQL Server on Linux, you use the following command:
/etc/init.d/mysqld stop 
Some Linux distributions provide server command:
service mysqld stop 
service mysql stop 

Stop MySQL Server on Windows

On Windows, you can stop MySQL Server using the program mysqladmin.
The program mysqladmin locates in the folder \bin, where path_to_installation_dir is the path to the installation directory e.g.,
 C:\Program Files\MySQL\MySQL Server 8.0\
Typically, you should add the pathname of the MySQL bin directory to Windows path environment variable to access any MySQL programs in the bin directory faster.
To stop MySQL, you follow below steps:
  • launch the Command Prompt by pressing Windows+R to open the Run box and type cmd and press Enter.

  • navigate to the bin folder of the MySQL if it is not in the Window path environment.

  • use the following command to stop MySQL Server:

  • mysqladmin -u root -p shutdown
    Enter password: ********
    It prompts for a password of the root account. You need to enter the password and press the Enter keyboard.
    The program will stop the MySQL Server.