【问题标题】:Failed to add client-to-server port forwarding rule on 127.0.0.1:3306在 127.0.0.1:3306 上添加客户端到服务器端口转发规则失败
【发布时间】:2020-01-24 07:50:48
【问题描述】:

我打开 ssh 隧道,在 Windows 上使用 Putty,设置端口 3306 以从外部网络远程连接到 Ubuntu 14.04 操作系统上的 MySql 服务器数据库。 而且我只在端口 3306 上收到以下错误:

Failed to add client-to-server port forwarding rule on 127.0.0.1:3306: Address is already in use; bind () in ListeningSocket :: StartListening () failed: Windows error 10013: Attempting to access the socket in ways not allowed by the respective access authorizations.

对于其他端口...例如 5900 和 2222,隧道正常工作,我不明白为什么会出现错误,因为我还执行了检查 Ubuntu 上的端口的命令

sudo lsof -i: 3306

我发现了

COMMAND  PID   USER   FD   TYPE  DEVICE  SIZE/OFF  NODE NAME

mysql    8637  mysql  10u  IPv4  37615     0t0     TPC  *: mysql (LISTEN)

我必须进行哪些更改才能使端口 3306 上的隧道为我工作?提前致谢

【问题讨论】:

  • 发现问题...问题不是 Ubuntu 上的 MySQL 服务器,而是 Windows 10 使用 IPv6 和相同的 3306 端口,因此该端口被标记为已在使用中。为避免此问题,请使用端口 3306 停止 IPv6,例如使用 TCPView 程序并验证 Putty 在 SSH 中打开隧道。然后连接到 MySQL Workbench 并连接到 127.0.0.1 端口:3306 就可以了。
  • 您已正确指出问题是 IPv6 并通过在启动计算机上禁用它来解决。创建答案并将此问题标记为已解决!

标签: mysql-workbench ubuntu-14.04 portforwarding ssh-tunnel tunnel


【解决方案1】:

我也有

bitvise failed to add server-to-client port forwarding rule 127.0.0.1:8080: Operation was rejected

我使用了 bitvise 并尝试进行远程端口转发。正如@IISanto 指出的那样。这是通过在启动 Windows 机器上禁用 IPv6 协议来解决的。之后效果很好:

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2010-11-14
    • 1970-01-01
    • 2016-02-23
    • 2015-12-19
    • 1970-01-01
    • 2016-10-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多