首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >无法在端口3306上启动MySQL

无法在端口3306上启动MySQL
EN

Stack Overflow用户
提问于 2019-11-19 18:43:53
回答 2查看 3.2K关注 0票数 1

我已经在D:\xampp中的Windows 10机器上安装了XAMPP (Apache、MySQL、php、phpmyadmin),我已经使用了至少3个月,没有出现任何问题。

从今天起,没有更改任何配置,也没有安装任何,当尝试启动MySQL时,我在XAMPP窗口中得到了这个错误:

代码语言:javascript
运行
复制
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中是:

代码语言:javascript
运行
复制
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进程或服务正在运行
  • 端口3306在运行netstat时不显示
  • Windows防火墙中未阻塞

如果我将端口更改为随机(如10200),MySQL将正常启动和工作。端口3307和3308不工作,即使它们看起来也没有在使用,就像3306一样。

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

  • (显然)重新启动XAMPP和PC
  • 清除D:\xampp\mysql\data目录
  • XAMPP的清洁安装
  • 以管理员身份运行
  • 从窗口的控制台启动MySQL
  • 重置防火墙规则
  • 关闭防火墙/防病毒

正如我前面提到的,在一些不同的端口上运行MySQL (比如10200 )是可行的。因此,除了能够再次在3306上运行MySQL之外,我还想知道到底发生了什么以及它是如何发生的。任何想法都值得赞赏!

编辑:有一个Windows (KB4522741),但我不认为它有什么关系。

EN

回答 2

Stack Overflow用户

发布于 2020-11-17 07:11:45

您可能面临此问题,因为在端口3306上正在处理其他服务。这也可能是由于在您的系统中安装了MySQL (不包括随xampp安装的那个)。

我的解决方案:直接到机器上MySQL服务器中的bin文件夹,并在命令提示符下从该目录运行此命令。(例如: C:\Program \MySQLServer8.0\bin) mysqladmin -u根-p关机

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

希望这能有所帮助!

票数 0
EN

Stack Overflow用户

发布于 2020-10-22 15:52:20

你需要更新窗口。对我来说很管用

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58940885

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档