无法在端口3306上启动MySQL

时间:2019-11-19 18:43:53

标签: mysql xampp mariadb

我在D:\xampp的Windows 10计算机上安装了XAMPP(Apache,MySQL,php,phpmyadmin),我已经使用了至少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
  • 以管理员身份运行
  • 从Windows的控制台启动MySQL
  • 重置防火墙规则
  • 关闭防火墙/防病毒软件

正如我之前提到的,在某些不同的端口(例如10200)上运行MySQL是可行的。因此,除了能够再次在3306上运行MySQL之外,我还想了解到底发生了什么以及它是如何发生的。任何想法表示赞赏!

编辑:有一个Windows更新(KB4522741),但我认为这并没有什么关系。

2 个答案:

答案 0 :(得分:0)

您可能会遇到此问题,因为端口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上启动服务器。这对我有用。

希望这会有所帮助!

答案 1 :(得分:-1)

您需要更新窗口。对我有用