无法在 MySQL Workbench 中连接到 127.0.0.1 处的 MySQL。系统错误61

发布于 2024-11-04 15:05:22 字数 956 浏览 1 评论 0原文

我在使用 MySQL Workbench 时遇到了一些问题。 情况就是这样,我正在开发一个数据库来从Android设备远程查询它。这是我第一次使用 MySQL Workbench,因此我遵循了本教程:

http://net.tutsplus.com/tutorials/databases/visual-database-creation-with-mysql-workbench/

我创建 EER 图并生成 SQL 没有问题 脚本。当我尝试连接到 MySQL 服务器时,问题就出现了。我收到此错误:

无法使用 root 用户在 127.0.0.1:3306 连接到 MySQL。在‘读取初始通信数据包’时失去与 MySQL 服务器的连接,系统错误:61

http://img101.imageshack.us/i/capturadepantalla201104i.png/ (如果链接停止工作告诉我)

我还尝试使用本地套接字/管道连接方法MAMP 套接字位于“/Applications/MAMP/tmp/mysql/mysql.sock”中,但它给出了相同的错误。我也尝试过使用 MAMP 端口 8889 但仍然没有任何结果。

那么有人知道如何解决它吗?还有一个问题,我可以在不使用 MAMP 的情况下从 Android 设备连接到我的笔记本电脑(数据库所在的位置)吗? MySQL 需要 MAMP 来服务查询吗?最后一件事,我走的路正确吗?或者我应该以其他方式做?

感谢您的阅读。

I'm running into a little trouble with MySQL Workbench.
This is the situation, I'm developing a database to query it remotely from Android devices. This is the first time I use MySQL Workbench, so I've followed this tutorial:

http://net.tutsplus.com/tutorials/databases/visual-database-creation-with-mysql-workbench/

I have no problem creating the EER diagram and generating the SQL script. The problem comes when I try to connect to a MySQL server. I get this error:

"Failed to Connect to MySQL at 127.0.0.1:3306 with user root. Lost connection to MySQL server at 'reading initial communication packet', system error: 61"

http://img101.imageshack.us/i/capturadepantalla201104i.png/ (if the link stops working tell me)

I've also tried using the Local Socket/Pipe connection method with the MAMP Socket in '/Applications/MAMP/tmp/mysql/mysql.sock', but it gives the same error. And I've also tried using MAMP port 8889 but still nothing.

So anyone knows how to fix it? And another question, can I connect from my Android device to my laptop(where the database is placed) without using MAMP? MySQL needs MAMP to serve queries? And the last thing, am I going into the right way? Or should I do it other way?

Thanks for reading.

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

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

发布评论

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

评论(9

深爱成瘾 2024-11-11 15:05:22

我遇到了同样的问题,但你的问题的一部分是为我解决的问题:

  1. 设置连接=本地套接字/管道

  2. 设置套接字路径=“/应用程序/ MAMP/tmp/mysql/mysql.sock"(对我来说 - 我在初始化时从 MySQL 日志中获取了路径)

运行:MBP,OSX 10.8.3(Mountain Lion),MAMP Pro

无法真正进一步了解您的问题可能是什么,但也许仔细检查您的数据库是否已正确初始化。但是,也许这对其他人有帮助:)

I had the same issue, but part of your question is what fixed it for me:

  1. Set connection = Local Socket/Pipe

  2. Set socket path = "/Applications/MAMP/tmp/mysql/mysql.sock" (for me - I got the path from my MySQL log upon initialisation)

Running: MBP, OSX 10.8.3 (Mountain Lion), MAMP Pro

Can't really fathom any further what your issue may be, but perhaps double check your DB is properly initialised. But, perhaps this helps someone else :)

月野兔 2024-11-11 15:05:22

我输入: sudo /usr/local/mysql/support-files/mysql.server start
进入终端,它成功启动了 MySQL 服务器,并且我能够连接到 MYSQL Workbench。

I typed: sudo /usr/local/mysql/support-files/mysql.server start
into the terminal and it started the MySQL server successfully and I was able to connect to MYSQL workbench.

狠疯拽 2024-11-11 15:05:22

您需要确保您的系统中正在运行 Mysql 进程。不确定在 MAC 中,但在 Windows 中它称为 mysqld.exe,

我们看看

http://lists.mysql。 com/mysql/124371

You need to sure that Mysql process is running in your system. not sure in MAC but in windows it'called mysqld.exe

well take a look

http://lists.mysql.com/mysql/124371

穿越时光隧道 2024-11-11 15:05:22

最常发生在数据库/服务器未运行时。您需要检查您的服务器,或者重新启动它。如果您在服务器管理下有 mysql 工作台,则可以这样做。检查重新启动或启动服务器的手册。

Most commonly happens when database/server is not running. You need to check your server, or restart it. You can do so if you have mysql workbench under server administration. Check your manual for restarting or starting the server.

梦旅人picnic 2024-11-11 15:05:22

在 osx 10.6 上,使用 mamp pro 我通过在主窗口的 MySQL 选项卡中允许网络访问解决了这个问题。希望它也能减轻某人的痛苦

On osx 10.6 using mamp pro I solved this by allowing network access in the MySQL tab from the home window. Hope it saves someone the pain too

会发光的星星闪亮亮i 2024-11-11 15:05:22

当尝试使用 MySQL Workbench 并通过 SSH 隧道进行连接时,如果 SSH 连接未成功完成(例如不正确的主机、密码、密钥文件等),您将收到此错误。

解决此问题的一个好方法是单独测试与您尝试连接的计算机建立 ssh 连接,并确定您可以成功连接。

When trying to use the MySQL Workbench and connect through an SSH tunnel, you will get this error when your SSH connection does not complete successfully (e.g. improper host, password, key file, etc)

A good way to trouble shoot this is to separately test the the ssh connection from the machine you are trying to connect from and establish that you can do so successfully.

请持续率性 2024-11-11 15:05:22

尝试关闭 MySQL 并以管理员身份运行它。这对我有用。

Try closing MySQL and running it as the admin. This worked for me.

且行且努力 2024-11-11 15:05:22

进行上述改进后,例如检查mysql服务是否正在运行,您只需在创建连接时输入一个小密码,它是' '或按1次GUI 或工作台中的空格键。
之后,您只需使用服务器验证您的计算机(经过验证的主机)。
为此,单击“新服务器实例”,它将代表您自行配置服务器/主机

就在几分钟前,我成功完成了这项工作。我的工作台软件现在能够显示所有预安装数据库等。

谢谢!!!

After making above improvement such as checking if mysql service is running or not, you just need to give a small password while creating connection, it is ' ' or 1 time press on space-bar in case of GUI or workbench.
After which you just need to validate your machine with server (validated HOST).
For that purpose click on 'New Server Instance' and it will configure server/HOST on your behalf itself.

I have done this successfully just a few couple of minutes ago. My workbench software is able to show all pre-installed databases etc now.

Thanks!!!

掐死时间 2024-11-11 15:05:22

我解决了!在 Mac 上,只需转到屏幕右上角的聚光灯搜索并输入 Mysql。打开它。

I solved it! On a mac just go to spotlight search on the top right of the screen and type Mysql. Turn it on.

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