无法在端口3306上启动MySQL

无法在端口3306上启动MySQL,mysql,xampp,mariadb,Mysql,Xampp,Mariadb,我已经在Windows10机器上安装了XAMPP Apache、MySQL、php、phpmyadmin,安装在D:\XAMPP中,我已经使用了至少3个月,没有任何问题 从今天起,在没有更改任何配置或安装任何东西的情况下,在尝试启动MySQL时,我在XAMPP控制台窗口中遇到以下错误: 20:17:05 [mysql] Status change detected: running 20:17:08 [mysql] Status change detected: stopped 20

我已经在Windows10机器上安装了XAMPP Apache、MySQL、php、phpmyadmin,安装在D:\XAMPP中,我已经使用了至少3个月,没有任何问题

从今天起,在没有更改任何配置或安装任何东西的情况下,在尝试启动MySQL时,我在XAMPP控制台窗口中遇到以下错误:

20:17:05  [mysql]   Status change detected: running
20:17:08  [mysql]   Status change detected: stopped
20:17:08  [mysql]   Error: MySQL shutdown unexpectedly.
20:17:08  [mysql]   This may be due to a blocked port, missing dependencies, 
20:17:08  [mysql]   improper privileges, a crash, or a shutdown by another method.
20:17:08  [mysql]   Press the Logs button to view error logs and check
20:17:08  [mysql]   the Windows Event Viewer for more clues
20:17:08  [mysql]   If you need more help, copy and post this
20:17:08  [mysql]   entire log window on the forums
在mysql_error.log中:

InnoDB: using atomic writes.
2019-11-19 20:17:05 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2019-11-19 20:17:05 0 [Note] InnoDB: Uses event mutexes
2019-11-19 20:17:05 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2019-11-19 20:17:05 0 [Note] InnoDB: Number of pools: 1
2019-11-19 20:17:05 0 [Note] InnoDB: Using SSE2 crc32 instructions
2019-11-19 20:17:05 0 [Note] InnoDB: Initializing buffer pool, total size = 16M, instances = 1, chunk size = 16M
2019-11-19 20:17:05 0 [Note] InnoDB: Completed initialization of buffer pool
2019-11-19 20:17:06 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2019-11-19 20:17:06 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2019-11-19 20:17:06 0 [Note] InnoDB: Setting file 'D:\xampp\mysql\data\ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2019-11-19 20:17:06 0 [Note] InnoDB: File 'D:\xampp\mysql\data\ibtmp1' size is now 12 MB.
2019-11-19 20:17:06 0 [Note] InnoDB: Waiting for purge to start
2019-11-19 20:17:06 0 [Note] InnoDB: 10.4.8 started; log sequence number 300333; transaction id 171
2019-11-19 20:17:06 0 [Note] InnoDB: Loading buffer pool(s) from D:\xampp\mysql\data\ib_buffer_pool
2019-11-19 20:17:06 0 [Note] Plugin 'FEEDBACK' is disabled.
2019-11-19 20:17:06 0 [Note] Server socket created on IP: '::'.
2019-11-19 20:17:06 0 [ERROR] Can't start server: Bind on TCP/IP port. Got error: 10013: An attempt was made to access a socket in a way forbidden by its access permissions.


2019-11-19 20:17:06 0 [ERROR] Do you already have another mysqld server running on port: 3306 ?
2019-11-19 20:17:06 0 [ERROR] Aborting
但是,端口3306中似乎没有运行任何内容:

没有其他正在运行的MySQL进程或服务 运行netstat时,端口3306不显示 在Windows防火墙中未被阻止 如果我将端口更改为随机端口,例如10200,MySQL将启动并正常工作。端口3307和3308不工作,即使看起来它们也没有被使用,就像3306一样

我尝试过但没有解决问题的事情:

显然,重启XAMPP&PC 清除D:\xampp\mysql\data目录 XAMPP的清洁安装 以管理员身份运行 从窗口的控制台启动MySQL 重置防火墙规则 关闭防火墙/防病毒软件 正如我前面提到的,在不同的端口(比如10200)上运行MySQL是可行的。因此,除了能够再次在3306上运行MySQL之外,我还对了解到底发生了什么以及它是如何发生的感兴趣。任何想法都值得赞赏


编辑:有一个Windows更新,但我不认为这有什么关系。

您需要更新Windows。这对我很有效

您可能会遇到这个问题,因为端口3306上正在处理其他服务。这也可能是由于MySQL,而不是系统中安装的xampp安装程序

我的解决方案: 只需转到您机器上MySQL服务器中的bin文件夹,并在命令提示符下从该目录运行此命令。例如:C:\Program Files\MySQL\MySQL server 8.0\bin mysqladmin-u root-p关闭

此命令将安全地关闭在端口3306上运行的现有MySQL,以便您可以使用xampp上的MySQL访问同一端口。这可以在没有冲突或无需卸载其他应用程序的情况下工作,也可以在my.ini文件中将端口更改为3307。现在重新启动xampp控制面板并在端口3306上启动服务器。这对我有用


希望这有帮助

请尝试使用netstat-an | findstr 3306,查看是否有其他东西绑定到该端口。@lainatnavi已经尝试过,并且刚刚重新确认。返回空,因此我认为端口应该可用检查这个KBA,看看是否是这种情况。还要运行netsh int ipv6 show dynamicport tcp以查看保留端口的范围。无论如何,以管理员身份运行服务应该能够绑定任何端口。这可能也有帮助:看起来问题已经解决了。按照您给我指出的方向,我检查了具有netsh接口ipv4 show excludedportrange protocol=tcp的端口,实际上3306是保留的。然后我卸载了KB4522741,问题解决了!重新安装,以确保它是负责任的,但现在3306不是保留的,一切都很好。我不明白这一点,我不会想象Windows保留端口,更不用说像3306这样的普通端口了。。。非常感谢@lainatnavi的帮助。