【问题标题】:how to connect to wamp server from another computer/different pc如何从另一台计算机/不同的电脑连接到 wamp 服务器
【发布时间】:2016-12-12 13:51:46
【问题描述】:

我在 VB 中创建了一个应用程序。我已成功将应用程序连接到 wamp localhost(同一台计算机)。但是我无法从同一网络中的另一台计算机连接它。请帮我连接...

这是我的代码:

    Dim server1 As String
    Dim client1 As String

    Dim cmd As New Odbc.OdbcCommand
    server1 = "Driver={MySQL ODBC 5.1 Driver};Server=localhost;Database=db_checkvoucher;User=root;Password=;Option=3;"

    client1 = "Driver={MySQL ODBC 5.1 Driver};server=192.168.1.2;" _
        & "User=root;Password=;" _
        & "database=db_checkvoucher;"

    If Form1.TextBox1.Text = "1" Then
        con.ConnectionString = client1
    Else
        con.ConnectionString = server1
    End If

    cmd.Connection = New Odbc.OdbcConnection(con.ConnectionString)
        con.Open()

我收到此错误: 错误 [HY000] [MySQL][ODBC 5.1 驱动程序]无法连接到“192.168.1.2”上的 MySQL 服务器 (10060) 错误 [HY000] [MySQL][ODBC 5.1 驱动程序]无法连接到“192.168 上的 MySQL 服务器” .1.2' (10060) 我已经在服务器计算机上运行了 wamp server。

【问题讨论】:

    标签: vb.net connection client-server wamp wampserver


    【解决方案1】:

    这可能是您服务器上的防火墙的问题。

    有关如何允许 mysql 连接的说明,请参见此处。 http://portforward.com/english/routers/firewalling/Microsoft/WindowsXPFirewallFirewall/MySQL_Server.htm

    【讨论】:

      猜你喜欢
      • 2013-06-19
      • 1970-01-01
      • 1970-01-01
      • 2015-06-28
      • 2013-01-16
      • 2017-01-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多