Solved

Kill Mysql Sleepy Connections with ASP

Posted on 2014-01-14
3
317 Views
Last Modified: 2014-02-01
From time to time I find some sleepy connection in my mysql database. Im looking for a way to kill these through an asp page. I am looking for a code sample in asp.
0
Comment
Question by:garyilm
  • 2
3 Comments
 
LVL 32

Expert Comment

by:Big Monty
ID: 39780145
sorry to say but the most reliable way to do this is to go through your code and make sure you close each connection manually:

conn.open connectionString

'-- do stuff

if conn.State <> 0 then conn.Close
set conn = nothing
0
 
LVL 32

Expert Comment

by:Big Monty
ID: 39780147
if you've already checked this, you want to disable the autoconnect flag in MySQL, as this may be the problem as well.
0
 
LVL 33

Accepted Solution

by:
snoyes_jw earned 500 total points
ID: 39794309
Or just set mysql's wait_timeout to a smaller value so the problem will take care of itself. The default is 8 hours; change it to 30 or 60 seconds:

SET GLOBAL wait_timeout=30;

http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_wait_timeout
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

708 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

17 Experts available now in Live!

Get 1:1 Help Now