EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Probelms using MySQL over SSH Tunnel

Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.
#2667
Posted: 04/03/2007 12:26:00
by Rocco Valotta (Standard support level)
Joined: 04/03/2007
Posts: 3

I would like to say that I also am experiancing problems with MySQL over a SSH Tunnel.

The symptoms are as follows. It works great when the Tunnel is created in a different application then the database calls.

If you take your LocalPortForward, install MySQL-Connector-Net-5.0.6, add it as a refrence then add the following code

data = new DataTable();
MySqlDataAdapter da = new MySqlDataAdapter(sQuery, cn);
MySqlCommandBuilder cb = new MySqlCommandBuilder(da);
da.Fill(data);

You should experiance a lock up on the da.Fill
#2673
Posted: 04/03/2007 14:18:49
by Ken Ivanov (EldoS Corp.)

Thank you for your messages.

We have experienced similar problem with VCL edition some time ago. The problem was caused by an improper way in which MySQL DLL works with sockets. If MySQL Connector uses MySQL DLL to connect to MySQL database (it is likely to be so), the problem you are describing may be caused by the same reason.

We will investigate the issue and try to find a suitable solution for it.
#2683
Posted: 04/04/2007 08:08:39
by Ken Ivanov (EldoS Corp.)

We were able to solve the issue by moving the code that deals with MySQL Connector to a separate thread. The corresponding code follows:
Code
private void button1_Click(object sender, EventArgs e)
{
    Thread tr = new Thread(new ThreadStart(MySQLConnectFunc));
    tr.Start();
}

private void MySQLConnectFunc()
{
    String sQuery = "Select * from user;";
    MySqlConnection cn = new MySqlConnection("Database=mysql;Uid=root;Password=rtiffat;pooling=false;server=localhost;port=3307");
    DataTable data = new DataTable();
    MySqlDataAdapter da = new MySqlDataAdapter(sQuery, cn);
    MySqlCommandBuilder cb = new MySqlCommandBuilder(da);
    da.Fill(data);
}
#2731
Posted: 04/11/2007 11:43:17
by Rocco Valotta (Standard support level)
Joined: 04/03/2007
Posts: 3

Silly question, can I reverse the process and start the ssh tunnel in a new thread and keep the database calls in the application?

Reply

Statistics

Topic viewed 7416 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!