113 错误 mysql_mysql 2003 (113)

当尝试远程访问192.168.2.200主机的MySQL数据库时遇到错误2003。问题在于MySQL的配置和防火墙设置。解决方案包括取消`skip-networking`和`bind-address = 127.0.0.1`的注释,并关闭系统的防火墙。完成这些步骤后,远程连接成功建立。
摘要由CSDN通过智能技术生成

1. 问题描述远程访问192.168.2.200主机的mysql数据库时, 出现以下错误:[plain] view plain copy # mysql -host192.168.2.200 -uroot -p  Enter password:   ERROR 2003 (HY000): Can‘t connect to MySQL server on ‘192.168.2.200‘ (113)2. 解决方法首先确保mysql开启了远程授权: http://blog.csdn.net/cryhelyxx/article/details/40114695参考了: http://blog.csdn.net/qustdjx/article/details/26937325依然无法解决问题, 最后在网上搜索了下, 说是系统的防火墙开启的原因.参考了:

1.查看配置文件:

skip-networking #注释掉 因为它是屏蔽掉一切TCP/IP连接

bind-address = 127.0.0.1 #它和上一个选项是异曲同工,要想远程连接,也得注释掉

2.如果以上工作都做过还是出现:

ERROR 2003 (HY000): Can‘t connect to MySQL server on ‘*.*.*.*‘ (113),那就得考虑防火墙的问题了,关掉防火墙/etc/rc.d/init.d/iptables stop

修改完后需要 restart mysql (/etc/init.d/mysql restart)

得到了解决方法.现在关闭防火墙:[plain] view plain copy # /etc/rc.d/init.d/iptables stop  iptables: Setting chains to policy ACCEPT: filter          [  OK  ]  iptables: Flushing firewall rules:                         [  OK  ]  iptables: Unloading modules:                               [  OK  ]再次远程连接mysql数据库:[plain] view plain copy # mysql -h192.168.2.200 -uroot -p  Enter password:   Welcome to the MySQL monitor.  Commands end with ; or \g.  Your MySQL connection id is 2962  Server version: 5.5.22-log MySQL Community Server (GPL)    Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.    Oracle is a registered trademark of Oracle Corporation and/or its  affiliates. Other names may be trademarks of their respective  owners.    Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.    mysql>OK, 问题解决, Enjoy it!!!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值