MySQL Workbench“无法连接到Localhost” Windows 10上的错误,但我不是要连接到Localhost

发布于 2025-02-04 17:47:05 字数 815 浏览 4 评论 0原文

我希望有人可以帮助我。多年来,我一直在Windows 7上使用MySQL Workbench,但是现在我在Windows 10上获得了一台新机器,我安装了MySQL Workbench,但是当我尝试连接到数据库时,我总是会遇到相同的错误“无法连接到LocalHost”,但是我我会遇到。不是试图连接到Localhost,而是要连接到另一台DB服务器。 telnet到端口3306上的服务器工作正常,但MySQL Workbench甚至没有尝试连接到服务器 - 它立即散布了错误。日志只是说:

13:21:04 [err] [SQL编辑器表格]:sqleditorform:do_connect方法中的异常:异常:无法连接到localhost

13:21:04 [err] [err] [grtdispatcher]:grt execute_task中的异常继续:例外:无法连接到Localhost

13:21:04 [ERR] [grtdisPatcher]:wrorkle:任务'执行SQL查询'失败了错误:。无法连接到LocalHost

13:21:04 [err] [err] [err] [WQE] [WQE]后端]:连接期间有一个例外:无法连接到Localhost

13:21:04 [err] [SQL Editor表格]:无法连接SQL编辑器:无法连接到Localhost

13:21:04 [ERR] [err] [SQL] [SQL]编辑表格]:您的连接尝试失败了MyDbserVerip的MySQL Server的用户“ Myuser”:3306: 无法连接到Local主机,

有人可以告诉我,当我配置其他IP地址时,为什么要连接到Localhost(如果那是它在做什么)? 先感谢您。

I hope someone can help me. I was using MySQL Workbench on Windows 7 for years, but now I got a new machine on Windows 10, I installed MySQL Workbench but when I try to connect to a database I always get the same error "Unable to connect to localhost" but I am not trying to connect to localhost but to another DB server. Telnet to the server on port 3306 works fine but MySQL Workbench doesn't even try to connect to the server - it immediately spews the error. The log just says:

13:21:04 [ERR][SQL Editor Form]: SqlEditorForm: exception in do_connect method: Exception: Unable to connect to localhost

13:21:04 [ERR][ GRTDispatcher]: exception in grt execute_task, continuing: Exception: Unable to connect to localhost

13:21:04 [ERR][ GRTDispatcher]: worker: task 'execute sql queries' has failed with error:.Unable to connect to localhost

13:21:04 [ERR][ WQE backend]: Got an exception during connection: Unable to connect to localhost

13:21:04 [ERR][SQL Editor Form]: SQL editor could not be connected: Unable to connect to localhost

13:21:04 [ERR][SQL Editor Form]: Your connection attempt failed for user 'MyUser' to the MySQL server at MyDBserverIP:3306:
Unable to connect to localhost

Can someone please tell me why is it trying to connect to localhost (if that is even what it is doing) when I am configuring a different IP address?
Thank you in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

变身佩奇 2025-02-11 17:47:05

确保您设置了目标服务器(主机)中MySQL配置文件的bid-address属性。

Ubuntu中的位置如下:

/etc/mysql/mysql.conf.d/mysqld.cnf

搜索本节:

# If MySQL is running as a replication slave, this should be
# changed. Ref https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_tmpdir
# tmpdir                = /tmp
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address            = 127.0.0.1
mysqlx-bind-address     = 127.0.0.1

并相应地编辑。

如果要允许所有IP连接到您的服务器,则可以编辑为 0.0.0.0

Make sure you set the bid-address property of the MySQL configuration file in the target server (host).

The location in ubuntu is the following:

/etc/mysql/mysql.conf.d/mysqld.cnf

Search for this section:

# If MySQL is running as a replication slave, this should be
# changed. Ref https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_tmpdir
# tmpdir                = /tmp
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address            = 127.0.0.1
mysqlx-bind-address     = 127.0.0.1

and edit accordingly.

If you want to allow all ips to connect to you server, you can edit to 0.0.0.0

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文