SSH - connection problem

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply

SSH - connection problem

Post by 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

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


Post by 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.

Posts: 3
Joined: Sat 14 Jan 2006 11:41

Post by 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("", "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 !



Post by Serious » Fri 03 Feb 2006 08:02

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


Post by HOW? » Fri 03 Feb 2006 13:06

And how do I do that ????



Post by 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;

Post Reply