You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

XAMPP中MySQL启动异常求助:日志显示Server socket created on IP: '::'

解决XAMPP中MySQL启动后意外关闭的问题

问题重现及日志信息

XAMPP控制面板报错日志:

16:52:59  [mysql]   Attempting to start MySQL app...
16:52:59  [mysql]   Status change detected: running
16:53:01  [mysql]   Status change detected: stopped
16:53:01  [mysql]   Error: MySQL shutdown unexpectedly.
16:53:01  [mysql]   This may be due to a blocked port, missing dependencies, 
16:53:01  [mysql]   improper privileges, a crash, or a shutdown by another method.
16:53:01  [mysql]   Press the Logs button to view error logs and check
16:53:01  [mysql]   the Windows Event Viewer for more clues
16:53:01  [mysql]   If you need more help, copy and post this
16:53:01  [mysql]   entire log window on the forums

MySQL详细启动日志:

2022-10-25 16:52:59 0 [Note] Plugin 'FEEDBACK' is disabled.  // this is 2 prev launch sesion
2022-10-25 16:52:59 0 [Note] Server socket created on IP: '::'. // this is also prev launch sesion
2022-10-25 16:54:47 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2022-10-25 16:54:47 0 [Note] InnoDB: Uses event mutexes
2022-10-25 16:54:47 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-10-25 16:54:47 0 [Note] InnoDB: Number of pools: 1
2022-10-25 16:54:47 0 [Note] InnoDB: Using SSE2 crc32 instructions
2022-10-25 16:54:47 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M
2022-10-25 16:54:47 0 [Note] InnoDB: Completed initialization of buffer pool
2022-10-25 16:54:47 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2022-10-25 16:54:47 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2022-10-25 16:54:47 0 [Note] InnoDB: Setting file 'C:\Main\Aplikasi\XAMPP\mysql\data\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2022-10-25 16:54:47 0 [Note] InnoDB: File 'C:\Main\Aplikasi\XAMPP\mysql\data\ibtmp1' size is now 12 MB.
2022-10-25 16:54:47 0 [Note] InnoDB: Waiting for purge to start
2022-10-25 16:54:47 0 [Note] InnoDB: 10.4.24 started; log sequence number 561855; transaction id 973
2022-10-25 16:54:47 0 [Note] InnoDB: Loading buffer pool(s) from C:\Main\Aplikasi\XAMPP\mysql\data\ib_buffer_pool
2022-10-25 16:54:47 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-10-25 16:54:47 0 [Note] Server socket created on IP: '::'. // end of log

已知已尝试修改端口、重命名mysql/data为mysql/old_data、管理员模式运行XAMPP,问题依旧。


针对性解决方案

1. 删除损坏的InnoDB临时表空间文件

日志显示InnoDB完成了ibtmp1文件的创建,但后续进程无输出,大概率是这个临时文件损坏导致启动卡住:

  • 停止XAMPP所有服务
  • 找到路径C:\Main\Aplikasi\XAMPP\mysql\data\ibtmp1,删除该文件
  • 重新启动MySQL服务

2. 查看Windows事件查看器获取精准错误

XAMPP日志没有给出崩溃的具体原因,Windows事件查看器能提供更详细的报错:

  • 按下Win+R输入eventvwr打开事件查看器
  • 展开Windows日志 > 应用程序
  • 筛选来源为MySQL的事件,查看错误详情(比如权限不足、DLL缺失等)

3. 调整MySQL内存配置

当前innodb_buffer_pool_size设置为16M,可能过小导致初始化后崩溃:

  • 打开XAMPP控制面板,点击MySQL的Config按钮,选择my.ini
  • 找到innodb_buffer_pool_size = 16M,修改为innodb_buffer_pool_size = 64M
  • 保存后重启MySQL
  • 同时检查tmpdir配置项,确保指向的目录存在且XAMPP有读写权限

4. 清理残留的MySQL服务

如果系统中安装过独立版MySQL,可能存在服务冲突:

  • 按下Win+R输入services.msc打开服务管理器
  • 查找名称包含MySQL的服务,若有非XAMPP的MySQL服务,右键停止并设置为手动启动
  • 重新启动XAMPP的MySQL

5. 重新初始化MySQL系统表(针对重命名data后的情况)

如果之前重命名data目录后没有正确初始化系统表,会导致服务无法正常启动:

  • 停止XAMPP所有服务
  • 确保mysql/data目录不存在(如果之前重命名为old_data,直接保留即可)
  • 打开XAMPP的Shell,执行命令切换到mysql/bin目录:
    cd C:\Main\Aplikasi\XAMPP\mysql\bin
    
  • 执行初始化命令:
    mysqld --initialize-insecure
    
  • 初始化完成后,重新启动MySQL服务

内容的提问来源于stack exchange,提问作者SilvaneUX

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.15 09:01:30