安装MySQL8.0出现错误The service already exists!The current server installed

安装MySQL8.0出现错误

安装MySQL8.0出现的The service already exists!The current server installed:

这是我在安装MySQL的时候出现的一个服务冲突问题:

1
2
3
C:\Windows\system32>mysqld  install  mysql8
The service already exists!
The current server installed: D:\DB\mysql-8.0.17-winx64\bin\mysqld mysql8

这是因为在现在之前的MySQL的时候没有卸载干净(服务未关闭)

解决办法

管理员方式运行cmd

查询服务:输入 sc query mysql

1
2
3
4
5
6
7
8
9
C:\Windows\system32>sc query mysql8

SERVICE_NAME: mysql8
TYPE : 10 WIN32_OWN_PROCESS
STATE : 1 STOPPED
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x7d0

删除服务:输入 sc delete mysql

1
2
C:\Windows\system32>sc delete mysql8
[SC] DeleteService 成功

当出现 Delete Service 成功

此时,可以重新安装:

1
2
C:\Windows\system32>mysqld  install  mysql8
Service successfully installed.
-------------本文结束感谢您的阅读-------------