problem with ssh tunneling

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
ipilgrim
Posts: 3
Joined: Mon 29 Sep 2008 09:38

problem with ssh tunneling

Post by ipilgrim » Mon 29 Sep 2008 09:57

Hello!

I try to connect to a mysql server using ssh
MySqlConnection con = new MySqlConnection();
con.Protocol = MySqlProtocol.Ssh;
con.SshOptions.Host = "server_addr";
con.SshOptions.Port = 22;
con.SshOptions.User = "ssh_user_name";
con.SshOptions.Password = "ssh_user_pwd";
con.Port = 3306;
con.Host = "localhost";
con.UserId = "db_user_name";
con.Database = "db_name";
con.Password = "db_user_pwd";
con.Direct = false;

after con.Open();
I have this error: Can't connect to MySQL server on 'localhost' (10061)

When I look log file of ssh server, I can not find request from mysql component for authorization or connect to sever. I have blank log!

It's a bug or I'm missing something?

Feature of connect via ssh tunnel is very critical for our project.

Shalex
Site Admin
Posts: 8245
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Mon 29 Sep 2008 10:32

Please make sure that you set correct address of your SSH server in the string [con.SshOptions.Host = "server_addr";] and MySQL server in the string [con.Host = "localhost";]. Are SSH server and MySQL server located on the same machine or on different? Try setting the MySQL server address using IP address, domain name. Is the result the same? Please let us know.

ipilgrim
Posts: 3
Joined: Mon 29 Sep 2008 09:38

Post by ipilgrim » Mon 29 Sep 2008 10:40

Shalex wrote:Please make sure that you set correct address of your SSH server in the string [con.SshOptions.Host = "server_addr";] and MySQL server in the string [con.Host = "localhost";]. Are SSH server and MySQL server located on the same machine or on different? Try setting the MySQL server address using IP address, domain name. Is the result the same? Please let us know.
mysql server and ssh located on the same machine.
I try to set(con.SshOptions.Host) both variants (IP and domain name) but always got error
con.Host I try to set (localhost, 127.0.0.1)

Shalex
Site Admin
Posts: 8245
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Mon 29 Sep 2008 14:03

Please try setting for conn.Host not localhost or 127.0.0.1, but IP address or domain name of the machine where MySQL server is.

ipilgrim
Posts: 3
Joined: Mon 29 Sep 2008 09:38

Post by ipilgrim » Mon 29 Sep 2008 15:02

Shalex wrote:Please try setting for conn.Host not localhost or 127.0.0.1, but IP address or domain name of the machine where MySQL server is.
done. component connected direct to mysql server, without ssh tunnel.
con.Protocol = MySqlProtocol.Ssh;

Post Reply