在读取初始通信数据包时与MySQL服务器的连接丢失,系统错误:61 [英] Lost connection to MySQL server at 'reading initial communication packet', system error: 61
问题描述
3天的时间,撞墙了.我正在运行 mac os x.我已经安装了mysql-5.5.14-osx10.6-x86_64.dmg.
3 days on this and have hit a wall. I'm running mac os x. I have installed the mysql-5.5.14-osx10.6-x86_64.dmg.
就上下文而言,我需要安装mysql gem以便与ruby一起使用,除非有有效的mysql实例在运行,否则它将无法正确安装.
As far as the context, I need to install the mysql gem for use with ruby on rails and that won't install properly unless there is a valid instance of mysql running.
我尝试使用/Library/StartupItems/MySQLCOM/MySQLCOM [start | stop | restart]方法来启动mysql服务器,并且它没有错误地返回,但是当我尝试通过MySQL Workbench连接到localhost时,它总是说:
I've tried using the /Library/StartupItems/MySQLCOM/MySQLCOM [start|stop|restart] method to start the mysql server and it comes back with no errors, but when I try to connect to localhost via the MySQL Workbench, it always says:
您的连接尝试失败,用户'root'从您的主机到localhost:3306的服务器:在读取初始通信数据包"时失去与MySQL服务器的连接,系统错误:61"
"Your connection attempt failed for user 'root' from your host to server at localhost:3306: Lost connection to MySQL server at 'reading initial communication packet', system error: 61 ".
我的/var/mysql系统上没有路径,这表明捆绑的MySQL不存在吗?
I have no path on my system of /var/mysql, which indicates the Bundled MySQL is non existant?
我发现的其他解决方案表明我需要注释掉my.cnf中的绑定地址,但无法在系统上找到任何此类文件.
Other solutions I've found indicate I need to comment out the bind-address in my.cnf but I am unable to find any such file on my system.
我在想,安装的.dmg与我尝试的手册构建之间可能存在冲突.另外,我有一种直觉,感觉我的$ PATH中的某些内容正在混乱,这是我不理解的另一件事($ PATH内容).我在想我需要卸载其中一个,但是在没有证据表明以??开头的安装正确的情况下,我不知道如何正确卸载某个东西.
I'm thinking that maybe there is conflicts between the .dmg that's installed and the manual builds I've attempted. Also, I have a gut feeling that something in my $PATH is screwing with things, which is another thing I don't understand (the $PATH thing). I'm thinking I need to uninstall one or the other, but no idea how to properly uninstall something when there's no evidence that it's installed properly to begin with ??
有些事情可能会有所帮助:
Here are some things that may help:
我有一个/etc/my.cnf,内容为:
I have an /etc/my.cnf which reads:
[mysqld]
default-character-set=utf8
[client]
default-character-set=uft8
但没有/etc/mysql/my.cnf
but no /etc/mysql/my.cnf
- telnet IP 3306返回"IP:提供的节点名或服务名,或者未知".
- 我已经重启了很多次.
推荐答案
来自 Sequel Pro :
在服务器上,通过编辑/etc/my.cnf和在[mysqld]部分中注释或删除跳过网络.然后,重新启动MySQL Server.
On the server, configure MySQL by editing /etc/my.cnf and comment or remove skip-networking from the [mysqld] section. Then, restart MySQL Server.
在MySQL Ver 14.14 Distrib 5.1.67上,该行显示
On MySQL Ver 14.14 Distrib 5.1.67, this line says
默认情况下,它不是跳过网络,而是仅在本地主机上侦听,该主机更具兼容性,并且安全性也同样不错
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
应该有效-对我来说确实如此.
So commenting out bind-address = 127.0.0.1
should work - it did for me.
这篇关于在读取初始通信数据包时与MySQL服务器的连接丢失,系统错误:61的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!