Raymond Raymond

How to Start or Stop MySQL Service

event 2020-12-31 visibility 1,014 comment 0 insights toc
insights Stats

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 ]
More from Kontext
comment Comments
No comments yet.

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts