Page 1 of 1

SSH - connection problem

Posted: Fri 27 Jan 2006 19:19
by Guest
Hi I'm trying to connect to MySql with the SSH-protocol. I'm using the code below, but I get an error at then line: conDBAccess.SshOptions.User = "tunnel"
The error says: Object reference not set to an instance of an object.

What is wrong. I've done exactly like shown in the Documentation.



Shared Function BuildConnStr() As String
Dim strConn As String = "host=localhost;protocol=SSH;user=jisdb;password=password;Database=iis"
Return strConn
End Function


'MySql
Public Shared Function objdbConnect() As MySqlConnection
Dim conDBAccess As MySqlConnection = New MySqlConnection(BuildConnStr())
conDBAccess.SshOptions.User = "tunnel"
conDBAccess.SshOptions.Password = "password"
conDBAccess.SshOptions.Host = "192.168.100.193"
Return conDBAccess
End Function

Posted: Mon 30 Jan 2006 09:28
by Serious
We have fixed this bug for MySQLDirect .NET. Look forward for the next build.
Please use ConectionString parameters instead of corresponding MySqlConnection properties. When new build will be released you'll be able to use these propertis.

Posted: Thu 02 Feb 2006 17:12
by bumasoft
It still wont work. I've now made this:

Dim conDBAccess As MySqlConnection = New MySqlConnection(BuildConnStr())
conDBAccess.SshOptions = New SshOptions("192.168.100.193", "username", "password")

Now I get the message: Can't connect to MySql server on localhost.

There isn't any communication/traffic with the server at all !!
The IP is correct. I can connect to the server with putty and the same user/password.

What is wrong. I need this to work ... pleeeease !

Bumasoftware

Posted: Fri 03 Feb 2006 08:02
by Serious
Check if you can connect when setting SSH options in ConnectionString, not MySqlConnection.SshOptions property.

Posted: Fri 03 Feb 2006 13:06
by HOW?
And how do I do that ????

bumasoftware

Posted: Mon 06 Feb 2006 08:37
by Serious
Here is the example of connection string I've tested:

Code: Select all

host=server;user=usr;password=psw;database=test;port=3306;ssh host=sshServ;ssh user=sshUser;ssh password=sshPsw;protocol=SSH;