Solved

MySql - Lost Connection to mySql during query

Posted on 2009-05-06
7
1,039 Views
Last Modified: 2013-11-07
Hi,

I am supporting an application written in VB.net with MySql 5.0 as a backend
Recently  the application started to give error messages stating "Lost Connection to MySQL server during query"

This error can popup every then and now during any query, regardless of the  anything - just random....

I have changed timeouts, packetsizes - In short tried any suggestions that I could find on the MySql web site and other web resources

I have strong feeling that this is networking issue but I have no experience in troubleshooting such issues so I am lost at this point and need your help.

Any suggestions on what could be done?
Please note that this is production database and I am very limited in what I can do with it (at least I will need some good reasons to restart mySql or such things)

Please help!!!
0
Comment
Question by:Michael_D
  • 4
  • 2
7 Comments
 
LVL 5

Expert Comment

by:louislietaer
ID: 24317578
How long is your query ?
What the select command look like?


As your database is in production, you could install one mysql server on your pc very easily to make tour test. a dump and restore will be enough to restore data on your pc and the to run your tests without any streess ;)
0
 
LVL 15

Expert Comment

by:oobayly
ID: 24318403
I find Wireshark invaluable for troubleshooting Network issues, especially for apps that maintain an open connection to a server. Monitor any traffic on port 3306, look for large amounts of retransmissions or RST packets.

http://www.wireshark.org/
0
 
LVL 13

Author Comment

by:Michael_D
ID: 24318497
The problem is that it could be ANY query.
users get sometime this error when providing username and password to login to system.
select command looks like Select * from employee where empCode='bla-bla'
employee table have about 200 records with index on empCode

Also I noticed that this error most probably will appear after long idle time.
I am getting this errors even when I am working with database tools like Toad for MySql or SQLyog
let say I run a query that returns a result almost immediately. then I do something else for couple of minutes and refresh my query sometime the error to show up - there is no way to reproduce this - it just happens randomly. I realize that nothing can happen just "randomly" that why I am looking for a way to find what causing this.

As the production server - we do have another server for testing and development but the error never happens when I am connecting to that one - just on production server.
0
Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

 
LVL 13

Author Comment

by:Michael_D
ID: 24318751
>>> oobayly

Can you tell me how to configure the Wireshark so i can use the captured info? I am a software developer not a network administrator and have very limited knowledge of networks protocols. And my client is small family business and he cannot afford to hire a network professional to investigate this issue. But he paid for software and expect it work so it is kind of my responsibility to find and eliminate any issues...
0
 
LVL 15

Accepted Solution

by:
oobayly earned 500 total points
ID: 24319379
Is the server on a remote site?

As for using WireShark, for a simple capture, just select "Options" from the "Capture" menu.
Select the correct Network Card
Enter "tcp port 3306" in the "Capture Filter" textbox.

Keep the capture going, and have a look at anything abnormal, when you get a lost connection. Abnormal would be repeated retransmissions, resets while a data is being recived.

Optionally, you can also set a display filter to show all the mysql commands by entering "mysql" in the Filter textbox on the toolbar while a capture is running. This will filter out any of the TCP entries, but will make it less clear when an error occurs.
0
 
LVL 13

Author Comment

by:Michael_D
ID: 24355657
I have increased wait_timeout and seems like the amount of the lost connections decreased.

I am going to accept oobayly's suggestion to use WireShark as a tool to troubleshoot the issue. At least I have found that there is no abnormal packages traveling through network
0
 
LVL 13

Author Closing Comment

by:Michael_D
ID: 31578549
Thank you!
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SlingPlayer alternatives 1 36
Vb.net dynamic formulas in runtime 11 63
Run time Error 4 35
Advice on Xojo as a development tool over VB. 4 41
Foreword In the years since this article was written, numerous hacking attacks have targeted password-protected web sites.  The storage of client passwords has become a subject of much discussion, some of it useful and some of it misguided.  Of cou…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now