MYSQL - 无法连接到“本地主机”上的 MYSQL 服务器 (10061)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/385292/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 12:32:57  来源:igfitidea点击:

MYSQL - Cant connect to MYSQL server on 'localhost' (10061)

mysqlmysql-error-2003

提问by

Ive install wamp server on my PC(it has no internet or intranet connection, Windows XP -OS). But when I access MYSQL this error popup. Can you give any idea on how can i resolve this error. thank you very much.

我已经在我的 PC 上安装了 wamp 服务器(它没有互联网或内联网连接,Windows XP -OS)。但是当我访问 MYSQL 时会弹出这个错误。您能否就我如何解决此错误提出任何想法。非常感谢您。

Cant connect to MYSQL server on 'localhost' (10061)

无法连接到 'localhost' (10061) 上的 MYSQL 服务器

回答by Wouter van Nifterick

from the commandline (start/run/ type cmd, press ok), type:

从命令行(开始/运行/键入 cmd,按确定),键入:

telnet localhost 3306

If MySQL is running, you'll see the mysql version (and some garbage).

如果 MySQL 正在运行,您将看到 mysql 版本(和一些垃圾)。

To see if the service is running, type:

要查看服务是否正在运行,请键入:

sc query mysql

You'll see something like this if it's running:

如果它正在运行,你会看到这样的东西:

SERVICE_NAME: mysql
        TYPE               : 10  WIN32_OWN_PROCESS
        STATE              : 4  RUNNING
                                (STOPPABLE,PAUSABLE,ACCEPTS_SHUTDOWN)
        WIN32_EXIT_CODE    : 0  (0x0)
        SERVICE_EXIT_CODE  : 0  (0x0)
        CHECKPOINT         : 0x0
        WAIT_HINT          : 0x0

回答by Wouter van Nifterick

To check to see if MySQL is running, provided its installed as a service you can go to Start -> Control Panel -> Administrative Tools -> Services (i may be a bit off on those paths, I'm an OS X / Linux user), and look for MySQL on that list. See if it is started or stopped.

要检查 MySQL 是否正在运行,如果将其安装为服务,您可以转到开始 -> 控制面板 -> 管理工具 -> 服务(我可能在这些路径上有点偏离,我是 OS X / Linux用户),并在该列表中查找 MySQL。查看它是启动还是停止。

You can then do a portscan if you really want to and determine if that port is open. There are all kinds of free tools online that will scan your IP and tell you which ports are open and what is listening on them.

然后,如果您真的想要并确定该端口是否打开,您可以进行端口扫描。网上有各种免费工具可以扫描您的 IP 并告诉您哪些端口是开放的,哪些端口正在监听它们。

回答by acrosman

Unless you did something during the install, I believe that the port will be standard and the service will NOT be running after install.

除非你在安装过程中做了什么,我相信端口将是标准的,安装后服务将不会运行。

MySQL provides several GUI tools for managing servers: http://dev.mysql.com/downloads/gui-tools/5.0.htmlOne of those tools is the "MySQL System Tray Monitor" which will detect the running service, and allow you to stop and start the server easily. You can also review the list of services for "MySQL" to see if that service is active.

MySQL 提供了几个用于管理服务器的 GUI 工具:http://dev.mysql.com/downloads/gui-tools/5.0.html其中一个工具是“MySQL System Tray Monitor”,它将检测正在运行的服务,并允许您轻松停止和启动服务器。您还可以查看“MySQL”的服务列表以查看该服务是否处于活动状态。

If the service is running and you still can't connect, you need to make sure the Windows firewall is not blocking access to the port. If your firewall is not configured to notify you when it block a program (check the Windows Firewall control panel, it might not have notified you that it's detected the program).

如果该服务正在运行但您仍然无法连接,则需要确保 Windows 防火墙没有阻止对该端口的访问。如果您的防火墙未配置为在阻止程序时通知您(检查 Windows 防火墙控制面板,它可能没有通知您它已检测到该程序)。

回答by Filip Ekberg

Make sure it is running, check in my.cnf that it is really listening to the correct IP ( 127.0.0.1 ) and make sure you connect to the correct port aswell.

确保它正在运行,在 my.cnf 中检查它是否真的在侦听正确的 IP ( 127.0.0.1 ) 并确保您连接到正确的端口。

Try using telnet for debugging aswell and see where the problem lies, maybe mysql isnt started, or listens to a different port.

尝试使用 telnet 进行调试,看看问题出在哪里,也许 mysql 没有启动,或者侦听不同的端口。

回答by Md Majadul Islam

try to change a mysql port 3300 to "3306"

尝试将 mysql 端口 3300 更改为“3306”