I'm interested in using Devart's dotConnect for MySQL to establish an SSH tunnel to a FreeBSD 7.0 machine and securely access the MySQL database over the encrypted tunnel.
I'm having difficulties using the Password Authentication method. I get the error "Can't connect to SSH server on 'ip address': User authentication failed." Here is the code I'm using:
Code: Select all
Dim myConn As MySqlConnection = New MySqlConnection("host=localhost;protocol=SSH;user=root;password=password;database=database;")
myConn.Protocol = MySqlProtocol.Ssh
myConn.SshOptions.AuthenticationType = SshAuthenticationType.Password
myConn.SshOptions.Port = 22
myConn.SshOptions.Host = "" 'external address for SSH
myConn.SshOptions.User = "root" 'sshuser
myConn.SshOptions.Password = "" 'ssh password
Dim myCommand As MySqlCommand = New MySqlCommand("select count(*) from USER", myConn)
myConn.Open()
Dim count As Int64 = Convert.ToInt64(myCommand.ExecuteScalar())
Console.WriteLine(count)
myConn.Close()
Any clues as to what I may be doing wrong?
I'm using dotConnect for MySQL version 5.80.152.0