Connect to MySQL over SSH

Hi,

I would like to ask how to connect to MySQL over SSH using C#.

I am using the following code but it works only when not over SSH

What modification I should do to make it works?

try
{
    sql_connection = new MySqlConnection("server = 10.0.0.111; Port = 3306; Database = bizcards; Uid = root; Pwd = xxxxxx;");
    sql_connection.Open();

    MessageBox.Show("Connected!", "Yahoo!", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch (Exception exp)
{
    MessageBox.Show(String.Format("Error:{0}{1}", Environment.NewLine, exp.Message), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}

Thanks

Jassim

1 answer

Here is a MySQL ODBC connection instruction but you need their odbc driver to perform it.