SSH - connection problem

SSH - connection problem

Postby Guest » Fri 27 Jan 2006 19:19

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
Guest
 

Postby Serious » Mon 30 Jan 2006 09:28

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.
Serious
 

Postby bumasoft » Thu 02 Feb 2006 17:12

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
bumasoft
 
Posts: 3
Joined: Sat 14 Jan 2006 11:41

Postby Serious » Fri 03 Feb 2006 08:02

Check if you can connect when setting SSH options in ConnectionString, not MySqlConnection.SshOptions property.
Serious
 

Postby HOW? » Fri 03 Feb 2006 13:06

And how do I do that ????

bumasoftware
HOW?
 

Postby Serious » Mon 06 Feb 2006 08:37

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;
Serious
 


Return to dotConnect for MySQL