Tunnelling problem - Lost connection to MySQL server during

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
garik
Posts: 12
Joined: Wed 11 May 2011 18:55

Tunnelling problem - Lost connection to MySQL server during

Post by garik » Sun 11 Mar 2012 20:00

- Using 7.1.4 Pro in Delphi 2007
MyConnection show Connected status when I set it to true.
However, running any query returns the following error

Lost connection to MySQL server during query
Failed to connect to server script.


Running tunnel.php shows the following message

Code: Select all

Devart HttpTunnel v1.66
Tunnel script is installed correctly. 
You can establish connections through the HTTP tunnel.
_connections.id.php is created with the following content

Code: Select all


715674 653945 56333

httptunnel_server.log log shows the following

Code: Select all

11.03.2012 14:45:37 - Connected to remote  localhost: 3306
11.03.2012 14:45:37 - Waiting for client...
11.03.2012 14:45:38 - 715674 653945
11.03.2012 14:45:38 - Client accepted
11.03.2012 14:45:38 - Client: Reading from server script
11.03.2012 14:45:38 - Read from client (1): r
11.03.2012 14:45:38 - Script liftetime incremented with 180
11.03.2012 14:45:38 - Read from remote:(60)
11.03.2012 14:45:38 - Write to client(60): 8
5.1.56-log
11.03.2012 14:45:38 - Waiting for client...
11.03.2012 14:45:38 - Client: Read from server 60
11.03.2012 14:45:38 - Client: Written 82
11.03.2012 14:45:38 - Client accepted
11.03.2012 14:45:38 - Read from client (1): w
11.03.2012 14:45:38 - Script liftetime incremented with 180
11.03.2012 14:45:38 - Write from client: 82
11.03.2012 14:45:38 - Write to remote(82): N
11.03.2012 14:45:38 - Waiting for client...
11.03.2012 14:45:38 - Client: Reading from server script
11.03.2012 14:45:38 - Client accepted
11.03.2012 14:45:38 - Read from client (1): r
11.03.2012 14:45:38 - Script liftetime incremented with 180
11.03.2012 14:45:38 - Read from remote:(11)
11.03.2012 14:45:38 - Write to client(11): 
11.03.2012 14:45:38 - Waiting for client...
11.03.2012 14:45:38 - Client: Read from server 11
Any idea what's causing the problem?

Garik

AndreyZ

Post by AndreyZ » Mon 12 Mar 2012 14:30

Hello,

Please read the following articles:
http://dev.mysql.com/doc/refman/5.0/en/ ... ction.html
http://dev.mysql.com/doc/refman/5.0/en/gone-away.html
These articles cover all the situations when the "Lost connection to server during query" error can occur and the solutions that can help you avoid it.

garik
Posts: 12
Joined: Wed 11 May 2011 18:55

Post by garik » Tue 13 Mar 2012 02:14

Thanks for the links. After increasing the timeout to a minute I'm able to open small tables with a few records in it. Opening tables with a few hundred records is still very unstable and takes very long time.
Is there anything that could make the connection faster and more reliable?
The server itself is working very fast and I'm on 6Mb/s connection.

AndreyZ

Post by AndreyZ » Tue 13 Mar 2012 12:36

Please specify if you have BLOB fields in your tables which opening is slow. Also, we will be able to investigate your question more thoroughly if you provide access to your MySQL server. If you can do this, please send the code below with your values to andreyz*devart*com :

Code: Select all

MyConnection.Server := 'server';
MyConnection.Port := 3306;
MyConnection.Username := 'username';
MyConnection.Password := 'password';
MyConnection.Options.Protocol := mpHttp;  
MyConnection.HttpOptions.Url := 'url';
MyConnection.HttpOptions.Username := 'username';
MyConnection.HttpOptions.Password := 'password';

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Fri 16 Mar 2012 13:41

garik wrote:Thanks for the links. After increasing the timeout to a minute I'm able to open small tables with a few records in it. Opening tables with a few hundred records is still very unstable and takes very long time.
Please send the httptunnel_server log file that is generated in this case to dmitryg*devart*com.

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Thu 22 Mar 2012 10:50

Do you solve the problem using HTTP tunnelling?

garik
Posts: 12
Joined: Wed 11 May 2011 18:55

Post by garik » Tue 03 Apr 2012 15:27

Sorry for the delay. I didn't get any email notification about your posts and was waiting for you to get back to me via email as I gave you access to the server to do your own tests.

I'll run the tests again and send you the file you need.

garik
Posts: 12
Joined: Wed 11 May 2011 18:55

Post by garik » Fri 06 Apr 2012 02:01

here's the error log file

Code: Select all

05.04.2012 20:52:02 - Connected to remote  db2.xxxx.net: 3306
05.04.2012 20:52:02 - Waiting for client...
05.04.2012 20:52:03 - 329596 422553
05.04.2012 20:52:03 - Client accepted
05.04.2012 20:52:03 - Client: Reading from server script
05.04.2012 20:52:03 - Read from client (1): r
05.04.2012 20:52:03 - Script liftetime incremented with 180
05.04.2012 20:52:03 - Read from remote:(60)
05.04.2012 20:52:03 - Write to client(60): 8
5.1.61-log
05.04.2012 20:52:03 - Waiting for client...
05.04.2012 20:52:03 - Client: Read from server 60
05.04.2012 20:52:03 - Client: Written 72
05.04.2012 20:52:03 - Client accepted
05.04.2012 20:52:03 - Read from client (1): w
05.04.2012 20:52:03 - Script liftetime incremented with 180
05.04.2012 20:52:03 - Write from client: 72
05.04.2012 20:52:03 - Write to remote(72): D
05.04.2012 20:52:03 - Waiting for client...
05.04.2012 20:52:03 - Client: Reading from server script
05.04.2012 20:52:03 - Client accepted
05.04.2012 20:52:03 - Read from client (1): r
05.04.2012 20:52:03 - Script liftetime incremented with 180
05.04.2012 20:52:03 - Read from remote:(92)
05.04.2012 20:52:03 - Write to client(92): X
05.04.2012 20:52:03 - Waiting for client...
05.04.2012 20:52:03 - Client: Read from server 92
05.04.2012 20:53:03 - Client accepted
05.04.2012 20:53:03 - ERROR: Bad client.
05.04.2012 20:53:03 - Waiting for client...

garik
Posts: 12
Joined: Wed 11 May 2011 18:55

Post by garik » Fri 06 Apr 2012 02:13

Here's another log from the same server.
I have emailed you login information to access this server 2 weeks ago.

Code: Select all

05.04.2012 20:51:03 - 36742 307086
05.04.2012 20:51:03 - Failed to open _connections.id.php.
05.04.2012 20:51:03 - Connected to remote  db2.xxxx.net: 3306
05.04.2012 20:51:03 - Waiting for client...
05.04.2012 20:51:04 - 36742 307086
05.04.2012 20:51:04 - Client accepted
05.04.2012 20:51:04 - Client: Reading from server script
05.04.2012 20:51:04 - Read from client (1): r
05.04.2012 20:51:04 - Script liftetime incremented with 180
05.04.2012 20:51:04 - Read from remote:(60)
05.04.2012 20:51:04 - Write to client(60): 8
5.1.61-log
05.04.2012 20:51:04 - Waiting for client...
05.04.2012 20:51:04 - Client: Read from server 60
05.04.2012 20:51:20 - Client accepted
05.04.2012 20:51:20 - Read from client (1): w
05.04.2012 20:51:20 - Script liftetime incremented with 180
05.04.2012 20:51:20 - Write from client: 5
05.04.2012 20:51:20 - Write to remote(5): 
05.04.2012 20:51:20 - Waiting for client...
05.04.2012 20:51:20 - Client: Written 5
05.04.2012 20:51:20 - Client accepted
05.04.2012 20:51:20 - Read from client (1): x
05.04.2012 20:51:20 - Script liftetime incremented with 180
05.04.2012 20:51:20 - Shutting down on client request.
05.04.2012 20:51:20 - Server script closed.
05.04.2012 20:51:20 - Attempt to create client socket #2
05.04.2012 20:51:20 - Attempt to create client socket #3
05.04.2012 20:51:20 - Failed to connect to server script.

AndreyZ

Post by AndreyZ » Fri 06 Apr 2012 13:17

Thank you for the information. We have fixed both problems that you encountered with tunnelling. These fixes will be included in the next MyDAC build. But if you need these fixes as soon as possible, we can send you a custom MyDAC build with them. Please send your MyDAC license number to andreyz*devart*com .

Post Reply