无法连接到来自不同网络的 ngrok 服务隧道的 MySQL 数据库

问题描述 投票:0回答:0

我有这个 C# Winforms 应用程序,其中包含 MySQL 数据库连接字符串,在这种情况下,我使用 ngrok 来隧道服务器,用户应该能够将一些数据从应用程序插入数据库,现在我遇到了这个问题:当我尝试从不同的网络连接到数据库(通过使用命令

connection.Open
)时,我在 winform 应用程序上收到一条错误消息说
Timeout expired. Time timeout period elapsed prior to completion of the operation or the server is not responding.

这就是我开始 ngrok 转发的方式:

ngrok tcp 3306

ngrok 生成了这个 URL:

tcp://0.tcp.ap.ngrok.io:18649 -> localhost:3306

这是连接字符串示例(App.config):

<connectionStrings>
        <add name="CONNECTIONSETUP" connectionString="SERVER=0.tcp.ap.ngrok.io;Port=18649;DATABASE=mydb;UID=myuser;PASSWORD=mypass;" />
    </connectionStrings>

我在 Windows 10 操作系统上运行,关闭防火墙似乎无法解决问题。此问题仅发生在我网络外的设备上,并且在我网络上的不同设备上运行良好。

c# mysql ngrok
© www.soinside.com 2019 - 2024. All rights reserved.