XAMPP中MySQL意外停止无法启动,日志无有效错误信息求助
XAMPP中MySQL启动失败的问题排查与解决
问题现象
此前XAMPP中的MySQL运行正常,今日启动时出现以下错误提示:
Error: MySQL shutdown unexpectedly. 03:46:07 a. m. [mysql] This may be due to a blocked port, missing dependencies, 03:46:07 a. m. [mysql] improper privileges, a crash, or a shutdown by another method. 03:46:07 a. m. [mysql] Press the Logs button to view error logs and check 03:46:07 a. m. [mysql] the Windows Event Viewer for more clues 03:46:07 a. m. [mysql] If you need more help, copy and post this 03:46:07 a. m. [mysql] entire log window on the forums
查看MySQL日志后未发现明确错误信息,日志内容如下:
2023-05-09 3:47:47 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions 2023-05-09 3:47:47 0 [Note] InnoDB: Uses event mutexes 2023-05-09 3:47:47 0 [Note] InnoDB: Compressed tables use zlib 1.2.12 2023-05-09 3:47:47 0 [Note] InnoDB: Number of pools: 1 2023-05-09 3:47:47 0 [Note] InnoDB: Using SSE2 crc32 instructions 2023-05-09 3:47:47 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M 2023-05-09 3:47:47 0 [Note] InnoDB: Completed initialization of buffer pool 2023-05-09 3:47:47 0 [Note] InnoDB: 128 out of 128 rollback segments are active. 2023-05-09 3:47:47 0 [Note] InnoDB: Creating shared tablespace for temporary tables 2023-05-09 3:47:47 0 [Note] InnoDB: Setting file 'C:\xampp\mysql\data\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ... 2023-05-09 3:47:47 0 [Note] InnoDB: File 'C:\xampp\mysql\data\ibtmp1' size is now 12 MB. 2023-05-09 3:47:47 0 [Note] InnoDB: Waiting for purge to start 2023-05-09 3:47:47 0 [Note] InnoDB: 10.4.27 started; log sequence number 3283617; transaction id 3997 2023-05-09 3:47:47 0 [Note] InnoDB: Loading buffer pool(s) from C:\xampp\mysql\data\ib_buffer_pool 2023-05-09 3:47:47 0 [Note] Plugin 'FEEDBACK' is disabled. 2023-05-09 3:47:47 0 [Note] Server socket created on IP: '::'.
解决步骤
检查端口占用
打开命令提示符,执行命令:netstat -ano | findstr :3306若结果显示有其他进程占用3306端口,记录对应的PID,打开任务管理器结束该进程后,重新启动MySQL。
修复InnoDB临时表文件
- 停止XAMPP所有服务
- 进入XAMPP的MySQL数据目录(通常为
C:\xampp\mysql\data) - 删除
ibtmp1文件 - 重新启动MySQL服务
验证目录权限
右键XAMPP安装文件夹,选择「属性」→「安全」,确认当前用户对mysql\data文件夹拥有读写权限,若没有则添加当前用户并赋予完全控制权限。查看Windows事件查看器获取详细日志
按下Win+R组合键,输入eventvwr.msc打开事件查看器,依次展开「Windows日志」→「应用程序」,查找MySQL相关的错误事件,获取更精准的故障原因。
内容的提问来源于stack exchange,提问作者BORRONE CHENIS
相关产品推荐
相关产品推荐

