access_time 7 months ago languageEnglish

How to Start or Stop MySQL Service

visibility 32 comment 0

Start MySQL service

To start MySQL service on a UNIX-alike system or on Windows Subsystem for Linux (WSL), simply run the following command:

sudo service mysql start

The output looks like the following:

 * Starting MySQL database server mysqld                                                                                No directory, logging in with HOME=/
                                                                                                             [ OK ]

Check MySQL service status

Run the following command to check service status:

$ sudo service mysql status
 * /usr/bin/mysqladmin  Ver 8.42 Distrib 5.7.32, for Linux on x86_64
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective

Server version          5.7.32-0ubuntu0.18.04.1
Protocol version        10
Connection              Localhost via UNIX socket
UNIX socket             /var/run/mysqld/mysqld.sock
Uptime:                 1 min 35 sec

Threads: 1  Questions: 8  Slow queries: 0  Opens: 108  Flush tables: 1  Open tables: 26  Queries per second avg: 0.084

Stop MySQL service

To stop the service, simply run the following command:

sudo service mysql stop
 * Stopping MySQL database server mysqld                                                                      [ OK ]
copyright This page is subject to Site terms.
Like this article?
Share on

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts

Follow Kontext

Get our latest updates on LinkedIn.

Want to contribute on Kontext to help others?

Learn more

More from Kontext

visibility 3841
thumb_up 1
access_time 8 months ago
visibility 45
thumb_up 0
access_time 7 months ago