How to Start and Stop MySQL Server on CentOS

In this tutorial, we are going to see how to Start and Stop MySQL Server on CentOS operating system. Privileges required to start or stop or restart MySQL Server, user must be superuser.

We can start, stop, and restart the MySQL Server from Linux shell and We can stop and restart MySQL Server Shell.

To check the MySQL Server status execute either of two commands from Linux shell:

service mysqld status

systemctl status mysqld

Start and Stop MySQL Server on Linux
Start and Stop MySQL Server on CentOS

To stop MySQL Server from Linux shell:

service mysqld stop

systemctl stop mysqld

To Start MySQL Server from Linux shell:

service mysqld start

systemctl start mysqld

To Restart MySQL Server on Linux from Linux shell:

service mysqld restart

systemctl restart mysqld

To stop MySQL Server from MySQL shell:

mysql > SHUTDOWN;

then type exit and check the status.

To restart MySQL Server from MySQL shell:

RESTART;