In my VB.NET Application I check for the connection whether it is successful or not.
Dim conString As String = "server=public ip here; port=3306; database=test; uid=test; pwd=testp"
Public Function CheckServer() As Boolean
mySqlCon = New MySqlConnection
mySqlCon.ConnectionString = conString
Try
mySqlCon.Open()
mySqlCon.Close()
MsgBox("Connected!")
Return True
Catch ex As MySqlException
MsgBox("Connection failed!", MsgBoxStyle.Critical)
Return False
Finally
mySqlCon.Dispose()
End Try
End Function
My issue is that when I publish this test application and send it to my friend to test it, he always get the error connection failed.
Here is what I have done if it helps :
- Port forwarded port 3306 under my private ip address
- Edited phpmyadmin.conf file to Allow from all
- Edited config.inc.php file 'user' to test
- Edited config.inc.php file 'password' to testp
- Edited config.inc.php file 'host' to 192.168.0.x (my private ip)
- Edited config.inc.php file 'Allow no password' to false
- In phpmyadmin, under User settings, I have grant full privileges to test and set host to %
Conclusion : I understand that by doing this I risk having to loosen up my security and stuff but I am fine with this as this is just a test PC for me to learn. Nothing important or whatsoever in here.
So how do I access the WAMP database in my current PC with a VB.NET application if it was started on another PC on another network?