一、查询服务
单击开始,找到命令提示符,右击以管理员身份运行
C:\WINDOWS\system32>sc query mysql80
SERVICE_NAME: mysql80
TYPE : 10 WIN32_OWN_PROCESS
STATE : 4 RUNNING
(STOPPABLE, PAUSABLE, ACCEPTS_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
二、停止服务
C:\WINDOWS\system32>net stop mysql80
MySQL80 服务正在停止.
MySQL80 服务已成功停止。
三、启动服务
C:\WINDOWS\system32>net start mysql80
MySQL80 服务正在启动 ..
MySQL80 服务已经启动成功。
四、登录测试
C:\WINDOWS\system32>mysql -u root -p
Enter password: ******
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.26 MySQL Community Server - GPL
Copyright (c) 2000, 2021, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> select version();
+-----------+
| version() |
+-----------+
| 8.0.26 |
+-----------+
1 row in set (0.00 sec)
mysql> quit
Bye