咱直接进入主题。
我遇到的问题是net start mysql 服务无法启动,服务没有报告任何错误
notion image
notion image
其问题出在哪里呢

一.ini文件配置问题

在于你没有给你下载好的mysql文件中配置.ini文件。
notion image
notion image
该如何配置呢。那就是先在文件夹中创建一个文本文件,把下面内容复制进去(根据自身下载的mysql文件夹位置改一下)
notion image
这就是我的存放mysql的路径。(供参考),这里的data文件,刚开始是没有的,不用担心。别自己创建。
notion image
notion image
如此之后打开命令提示符(用管理员身份打开)
notion image
notion image
notion image
notion image
打开后  默认在C盘    (例如我在d:盘)
咱们这么操作
notion image
notion image
重点流程1:在bin目录下执行命令行  mysqld --initialize --console(出现下面错误就是data包好像有点问题,删了,重试)
notion image
notion image
notion image
notion image
箭头指的是你的mysql初始密码。
如果已安装mysql服务,需要先删除该服务  sc delete mysql
notion image
notion image
安装MySQL服务  mysqld --install mysql
notion image
notion image
编辑再次尝试启动MySQL服务
net start mysql
notion image
notion image
如果如此还不行,那下一步。

2.data包有问题,将data包直接删除,

从上面的    重点流程1   开始执行。
还不行。

3.mysql所需要的端口号被占用。

打开命令提示符(用管理员身份打开)
使用命令    netstat -ano       查看端口占用情况
可看到,我的3306端口被10180这个pid的应用占用
notion image
notion image
使用      taskkill /f /pid ****   命令结束占用端口的活动连接,xxxx就是端口对应的PID,我的PID是10180
再次输入  net start mysql,  可以看到连接成功
notion image
notion image
如果还是不行

4.注册表编辑器里的imagepath有问题

window+R   后输入 regedit,进入注册表编辑器
notion image
notion image
根据这一个个文件夹向下找
notion image
notion image
notion image
notion image
找到这里点击imagepath,路径照着这个参考填(加粗的填自己的文件位置)
"D:\SCHOOLWORK\JavaEE\mysql-8.0.36-winx64\bin\mysqld" --defaults-file=“D:\SCHOOLWORK\JavaEE\mysql-8.0.36-winx64\bin\my.ini”
然后再去按照重点流程1走一遍。
倘若还是不行,那就看看你是否环境变量里有配置mysql了吗

5.环境变量配置

打开高级系统设置
notion image
notion image
notion image
notion image
新建然后输入mysql的bin的位置信息
notion image
notion image
在去重复重点流程1.
在不行,你要不试试重装一下看看。(无奈了,)
还有一种可能就是你之前有装过,然后导致一些东西路径什么的冲突了,你要看仔细。该把之前的mysql删了就要删了。
 
JVM类加载机制详解:全过程+代码验证Docker部署Jenkins
Loading...