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.
problem with ssh tunneling
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.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.
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)