You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

XAMPP控制面板中MySQL启动失败求助:端口3306被占用

XAMPP MySQL无法启动:端口3306被占用(错误10048)

最近我在启动XAMPP控制面板里的MySQL时一直碰壁,每次点击启动按钮后都会立刻报错,控制面板显示的提示信息是:

13:28:19 [mysql] Error: MySQL shutdown unexpectedly.
13:28:19 [mysql] This may be due to a blocked port, missing dependencies,
13:28:19 [mysql] improper privileges, a crash, or a shutdown by another method.
13:28:19 [mysql] Press the Logs button to view error logs and check
13:28:19 [mysql] the Windows Event Viewer for more clues
13:28:20 [mysql] If you need more help, copy and post this
13:28:20 [mysql] entire log window on the forums

我打开MySQL的错误日志后,发现核心问题是端口3306被占用了,日志里重复出现这两行关键错误:

2022-07-29 13:26:49 0 [ERROR] Can't start server: Bind on TCP/IP port. Got error: 10048: Only one usage of each socket address (protocol/network address/port) is normally permitted.
2022-07-29 13:26:49 0 [ERROR] Do you already have another mysqld server running on port: 3306 ?

完整的错误日志内容如下,供大家参考:

2022-07-29 13:26:49 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2022-07-29 13:26:49 0 [Note] InnoDB: Uses event mutexes
2022-07-29 13:26:49 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-07-29 13:26:49 0 [Note] InnoDB: Number of pools: 1
2022-07-29 13:26:49 0 [Note] InnoDB: Using SSE2 crc32 instructions
2022-07-29 13:26:49 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M
2022-07-29 13:26:49 0 [Note] InnoDB: Completed initialization of buffer pool
2022-07-29 13:26:49 0 [Note] InnoDB: Starting crash recovery from checkpoint LSN=300288
2022-07-29 13:26:49 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2022-07-29 13:26:49 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2022-07-29 13:26:49 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2022-07-29 13:26:49 0 [Note] InnoDB: Setting file 'C:\xampp\mysql\data\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2022-07-29 13:26:49 0 [Note] InnoDB: File 'C:\xampp\mysql\data\ibtmp1' size is now 12 MB.
2022-07-29 13:26:49 0 [Note] InnoDB: Waiting for purge to start
2022-07-29 13:26:49 0 [Note] InnoDB: 10.4.24 started; log sequence number 300297; transaction id 170
2022-07-29 13:26:49 0 [Note] InnoDB: Loading buffer pool(s) from C:\xampp\mysql\data\ib_buffer_pool
2022-07-29 13:26:49 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-07-29 13:26:49 0 [Note] Server socket created on IP: '::'.
2022-07-29 13:26:49 0 [ERROR] Can't start server: Bind on TCP/IP port. Got error: 10048: Only one usage of each socket address (protocol/network address/port) is normally permitted.
2022-07-29 13:26:49 0 [ERROR] Do you already have another mysqld server running on port: 3306 ?
2022-07-29 13:26:49 0 [Note] InnoDB: Buffer pool(s) load completed at 220729 13:26:49
2022-07-29 13:26:49 0 [ERROR] Aborting
2022-07-29 13:28:17 0 [Note] InnoDB: The first innodb_system data file 'ibdata1' did not exist. A new tablespace will be created!
2022-07-29 13:28:17 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2022-07-29 13:28:17 0 [Note] InnoDB: Uses event mutexes
2022-07-29 13:28:17 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2022-07-29 13:28:17 0 [Note] InnoDB: Number of pools: 1
2022-07-29 13:28:17 0 [Note] InnoDB: Using SSE2 crc32 instructions
2022-07-29 13:28:17 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M
2022-07-29 13:28:17 0 [Note] InnoDB: Completed initialization of buffer pool
2022-07-29 13:28:17 0 [Note] InnoDB: Setting file 'C:\xampp\mysql\data\ibdata1' size to 10 MB. Physically writing the file full; Please wait ...
2022-07-29 13:28:17 0 [Note] InnoDB: File 'C:\xampp\mysql\data\ibdata1' size is now 10 MB.
2022-07-29 13:28:17 0 [Note] InnoDB: Setting log file C:\xampp\mysql\data\ib_logfile101 size to 5242880 bytes
2022-07-29 13:28:17 0 [Note] InnoDB: Setting log file C:\xampp\mysql\data\ib_logfile1 size to 5242880 bytes
2022-07-29 13:28:17 0 [Note] InnoDB: Renaming log file C:\xampp\mysql\data\ib_logfile101 to C:\xampp\mysql\data\ib_logfile0
2022-07-29 13:28:17 0 [Note] InnoDB: New log files created, LSN=11451
2022-07-29 13:28:17 0 [Note] InnoDB: Doublewrite buffer not found: creating new
2022-07-29 13:28:17 0 [Note] InnoDB: Doublewrite buffer created
2022-07-29 13:28:17 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2022-07-29 13:28:17 0 [Note] InnoDB: Creating foreign key constraint system tables.
2022-07-29 13:28:17 0 [Note] InnoDB: Creating tablespace and datafile system tables.
2022-07-29 13:28:17 0 [Note] InnoDB: Creating sys_virtual system tables.
2022-07-29 13:28:17 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2022-07-29 13:28:17 0 [Note] InnoDB: Setting file 'C:\xampp\mysql\data\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2022-07-29 13:28:17 0 [Note] InnoDB: File 'C:\xampp\mysql\data\ibtmp1' size is now 12 MB.
2022-07-29 13:28:17 0 [Note] InnoDB: Waiting for purge to start
2022-07-29 13:28:18 0 [Note] InnoDB: 10.4.24 started; log sequence number 0; transaction id 7
2022-07-29 13:28:18 0 [Note] Plugin 'FEEDBACK' is disabled.
2022-07-29 13:28:18 0 [Note] Server socket created on IP: '::'.
2022-07-29 13:28:18 0 [ERROR] Can't start server: Bind on TCP/IP port. Got error: 10048: Only one usage of each socket address (protocol/network address/port) is normally permitted.
2022-07-29 13:28:18 0 [ERROR] Do you already have another mysqld server running on port: 3306 ?
2022-07-29 13:28:18 0 [ERROR] Aborting

我已经尝试了Stack Overflow上的几种常见解决方案,比如在任务管理器里查找并结束MySQL相关进程、重启电脑、修改my.ini配置文件更换端口号,但都没能解决问题。有没有其他更有效的方法能帮我启动XAMPP里的MySQL?


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

火山引擎 最新活动