MySQL 错误 2013
当我运行程序超过几天时,我遇到了 MySQL 连接失败的问题。连接到数据库时,MySQL 错误代码为 2013。 MySQL服务器和客户端程序都在同一台机器上。 我使用 FC5 作为我的操作系统,MySQL 版本是 5.0.18。 有人能解释一下吗?
我在调用 mysql_real_connect() 时收到 mysql 错误 2013...
任何帮助表示赞赏。
I am facing connection failure to MySQL problem when I run my program for more than couple of days.MySQL Error Code is 2013 while connecting to Database. MySQL server and client programs are both on same machine. I am using FC5 as my OS and MySQL version is 5.0.18. Can anybody throw some light on this?
I am getting mysql error 2013 while calling mysql_real_connect()
...
Any help is appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
尝试使用 localhost,而不是您自己的 IP。
我不知道为什么,但这立即解决了我的问题。
如果有人能澄清,我将非常感激
为什么这突然起作用了。
Try using localhost, instead of your own IP.
I don't know why, but this immediately fixed the problem for me.
I would be very grateful if someone could clarify
why this worked, all of a sudden.
听起来像是防火墙问题。 您是否尝试过暂时禁用防火墙?
另一种可能的解决方案涉及编辑启动脚本,如此处所述 并注释掉以下行:
SKIP=skip-networking
提到了第三种可能的解决方案此处。 用户尝试访问 InnoDB 数据库,但 MySQL 服务器意外停用了 InnoDB 支持。
(新)我发现这篇 MySQL 官方文章 其中有很多解决问题的方法。 你修改了wait_timeout系统变量吗?
Sounds like a firewall issue. Have you tried disabling the firewall temporarily?
Another possible solution involves edition the startup script as mentioned here and commenting out the following line:
SKIP=skip-networking
A third possible solution is mentioned here. The user tried to access an InnoDB database and InnoDB support was accidentially deactivated for the MySQL server.
(new) I found this official MySQL article which has lots of approaches to solve the problem. Did you modify the wait_timeout system variable?
这是您可能意想不到的答案。 我也遇到过同样的问题。 MySQL 错误 2013。以下是症状:
PHPMyAdmin 触发了 2013 并出现错误 95。
我可以通过 shell 进入 MySQL 监视器,但花费了非常长的时间开始。 一旦命令行实用程序启动,我就可以查看表并且一切正常
服务器花了很长时间才能停止并重新启动。
MySQL 错误日志中没有错误。
我与一位优秀的系统管理员一起工作,他检查了 netstat -tn,得到了答案:
IP 解析为 Amazon Web Services。 尽管除了端口 80 之外的所有端口都是只允许的,但还是有一些混蛋正在窃取我的 3306 端口。 是时候检查我的防火墙规则了。
没有新表,mtop 没有显示任何活动,但我在身份验证日志中发现了大量这些活动:
在 iptables 中阻止有问题的 IP 后,问题突然消失了。 鬼鬼祟祟的混蛋。 这个故事的寓意是:看起来像错误的东西可能是黑客。
巴兹
Here's an answer you might not expect. I had encountered the same problem. MySQL Error 2013. Here are the symptoms:
PHPMyAdmin fired off 2013 and error 95.
I could shell into the MySQL monitor, but it took an inordinately long time to start. I could view tables and everything worked once the command line utility started
The server took a LONG time to stop and restart.
No errors in the MySQL error log.
I work with a good sysadmin who checked netstat -tn, which yielded the answer:
The IP resolves to Amazon Web Services. Some prick was leeching onto my 3306, even though everything but port 80 is allow-only. It's time to review my firewall rules.
There were no new tables, and mtop didn't show any activity, but I found a ton of these in the auth log:
After blocking the offending IP in iptables, the problem suddenly went away. Sneaky Bastards. The moral of this story is: What looks like bug, might be a hacker.
bz
检查你的 my.cnf。 将您的绑定地址设置为服务器的 IP 地址。 为我解决了这个问题。 似乎没有人知道这个问题的答案!
Check your my.cnf. Set your bind-address to the server's IP address. Solved the issue for me. NO ONE seemed to know the answer to that one!
我的解决方法是 - 将“localhost”更改为“127.0.0.1”
My fix was - change 'localhost' to '127.0.0.1'
可能是网络错误导致 TCP/IP 连接断开,或者超出了服务器上的 wait_timeout; 后者实际上有助于减少打开连接的数量,但应用程序将需要正确处理错误代码 2013!
It could be a network error that caused the TCP/IP connection to drop, or the wait_timeout was exceeded on the server; the latter can actually be useful in keeping the # of open connections down, but the app will then need to handle errorcode 2013 correctly!!