Let us understand how MySQL server can be started and stopped on Linux and Windows −
Linux – Start and Stop Server
On Linux, the start and stop can be done from the command line as shown below −
/etc/init.d/mysqld start /etc/init.d/mysqld stop
/etc/init.d/mysqld restart
Linux – Service Commands
Some Linux types offer service command as well −
service mysqld start
service mysqld stop
service mysqld restart
(or)
service mysql start
service mysql stop
service mysql restart
Windows – Start and Stop Server
Let us understand how it can be done on Windows −
Open ‘Run’ Window by using Win key + R
Type ‘services.msc’
Now search for MySQL service based on the version that is installed.
Click on ‘stop’, ‘start’ or ‘restart’ the service option.
Otherwise, the user can start/stop MySQL from the command prompt. It can be done as shown below −
C:\> "C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld"
C:\> "C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqladmin" −u root shutdown