MySQL Error 2013

 ̄綄美尐妖づ 提交于 2019-11-28 12:12:19

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.

  1. Sounds like a firewall issue. Have you tried disabling the firewall temporarily?

  2. Another possible solution involves edition the startup script as mentioned here and commenting out the following line:

    SKIP=skip-networking

  3. 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.

  4. (new) I found this official MySQL article which has lots of approaches to solve the problem. Did you modify the wait_timeout system variable?

Boot Zero

Here's an answer you might not expect. I had encountered the same problem. MySQL Error 2013. Here are the symptoms:

  1. PHPMyAdmin fired off 2013 and error 95.

  2. 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

  3. The server took a LONG time to stop and restart.

  4. No errors in the MySQL error log.

I work with a good sysadmin who checked netstat -tn, which yielded the answer:

tcp        0      0 [my.srv.ip]:3306     184.73.87.215:59271     ESTABLISHED
tcp        0      1 [my.srv.ip]:38138    184.73.87.215:113       SYN_SENT

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:

Apr 19 15:14:52 magic2 mysqld[18953]: refused connect from ec2-184-73-87-215.compute-1.amazonaws.com
Apr 19 15:18:02 magic2 mysqld[18953]: refused connect from ec2-184-73-87-215.compute-1.amazonaws.com

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

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!

My fix was - change 'localhost' to '127.0.0.1'

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!!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!