How to Start, Stop, and Restart MySQL Server

Summary: in this tutorial, you will learn how to start, stop, restart MySQL Server .

Start MySQL Server

On Linux, you can start the server with the following commands using serviceinit.d, and systemd.

Start MySQL Server using service

sudo service mysql start

Start MySQL Server using using init.d

sudo /etc/init.d/mysql start

Start MySQL Server using systemd

sudo start mysqld

Stop MySQL Server

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

Or

service mysql stop

Restart MySQL Server

You use the following command to restart the MySQL server On Linux:

service mysql restart

If the name is MySQL service is mysqld not mysql, you need to change the service name in the command as shown in the following command:

service mysqld restart

Or you can use the init.d to start the MySQL service:

/etc/init.d/mysqld restart

In this tutorial, you have learned how to start, stop, restart the MySQL server on  Linux.

Print Friendly, PDF & Email

Related posts:

Random posts:

%d bloggers like this: