How to kill mysql sleepy connections thru .Net ??

Hello all,

i want to kill mysql sleepy connections / threads... thru .net.....

how do i do that?

help needed.............

thanks in advance.


Thanks,
Krunal Mevada
0
krunalm
7/30/2007 5:30:38 AM
asp.net.mysql 1929 articles. 0 followers. Follow

3 Replies
801 Views

Similar Articles

[PageSpeed] 12

my idea is to use SHOW PROCESSLIST and save it temporarily to one of you table so that you can  play with the values like the "State" field that you want. and then issue a kill.. the syntax is KILL [CONNECTION | QUERY] thread_id.

For example we have an resultset after you issue a command SHOW PROCESSLIST like this and you saved it temporarily in a temptable and would look like this:

ID     User   Host        DB        Command   Time   State      Info
3123 stefan localhost apollon Query 0 NULL SHOW FULL PROCESSLIST

after that, you can now issue a kill command like: KILL CONNECTION (SELECT ID FROM temptable WHERE State=NULL)

Basically, you can do whatever you want, just giving you an idea. Happy coding!

 

Cheers,

CLIPER
 


------------------------------------------------
Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own commonsense. ---Buddha (563BC-483BC)
0
CLIPER
7/30/2007 12:46:59 PM

hi cliper,

thanx for ur comment.

but i got this "SHOW PROCESSLIST".....

Now i m direclty reading the result of show processlist and killing the sleepy connections.

there is no need to take this data into table.

Happy Coding.


Thanks,
Krunal Mevada
0
krunalm
7/31/2007 5:00:47 AM

well, that's good! :)

good luck!

 

Cheers,

CLIPER 


------------------------------------------------
Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own commonsense. ---Buddha (563BC-483BC)
0
CLIPER
7/31/2007 9:13:01 AM
Reply:

Similar Artilces:

MySQL
Currently have a site coded in PHP but the customer wants to go to .NET. Can I use the existing MySQL DB or am I required to use MSSQL? Thanks, Ken Check out this forum which is specialized for this kind of questions: ASP.NET MySQL forumBart De Smet [MVP] Visit www.msdn.be, www.bartdesmet.net...

Connecting to MySQL from VS.Net
I can connect to SQL server in VS.Net, but I cannot get to connect to my remote MySQL server. It would be great if I could use the same UI to admin the two server. Anyone know how I can do this ?...

How to kill MySql (sleepy) connections?
I found .Close() does not really close connections. MySql Administrator shows lots of unclosed/sleepy connections. How do you remove sleepy connections?Thanks! I think this link will help you.. Killing Sleeping Connections in C# ASP .NET http://www.primaryobjects.com/CMS/Article69.aspx  My Blog"Don't be afraid to be wrong; otherwise you'll never be right." I tried that link but it didn't work. The .Kill()  method was even available through .net. Fyi, the site you recommended uses ODBC, while I use the native connector ver 5.2. We will set connection...

System.Net.Sockets.SocketException with MySQL Connector.NET
Hi. I already tried many things and spent already 2 days without any success. Please help or I'll hang myself.I am using MySql.Data.dll  ver. 5.2.5.0 (runtime v2.0.50727) from my project (library). It works great if i use it from WindowsApplication but once i use it same way in WebApplication, it keeps throwing: The attempted operation is not supported for the type of object referencedException Details: System.Net.Sockets.SocketException: The attempted operation is not supported for the type of object referenced .. AsyncResult ias = socket.BeginConnect(endPoint, null, null);.. (or w...

mysql and .net
Hi there, i am new to .net and i am trying to setup a simple form. I am an open source person and what i am asking can be done easily using php and mysql; but i need to know how to do this in .net project asap. i have three forms; form1 submit to the database and redirect to form2 and form2 submit to the database and redirect to form3. i want to grab mysql last inserted id from form1 to form2 while redirecting and pass it via the url. i am able to select from the database, but i don't know how to assign it to a variable; here is what i have so far: str2 = "select last_ins...

MySql in VS.NET Data Connection?
I am curious if I can setup a MySql database in the Server Explorer DataConnection window, so I can use the elegant design features and the new data source functionality in VS.NET 2005? I have MySql and the connector installed, and I can connect programitically no problem. But I can't seem to find the driver or set it up manually as a Data Connection. Charlie 1、download MySQL Connector Net 1.0.7 and install .msi file. 2、copy "C:\Program Files\MySQL\MySQL Connector Net 1.0.7\bin\.NET 2.0\MySql.Data.dll" to "C:\Program Files\Microsoft.NET\Primary Interop Assemblies" and "your project's fl...

Net::MySQL
------=_NextPart_000_0026_01C30A6E.486AE070 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Anyone run into this problem=20 $mysql->query(q{ INSERT INTO dbname (table_name) VALUES ( $var ) }); The problem is, when I assign a value to a $var that value is ignored in = the SQL statement. Ive tried every operator I know to get it to look at = it and accept the value as input into the DB. Ive tried=20 ( '$var' ) ("$var") ("\$var") ([$var]) ({$var}) Any ideas ? Kind regards...

how to connect to a MySql database by ado.net
say suppose my backend is MySql database then how could i connect to MySql database by ado.net.please give me a sample code. Exploring MySQL in the Microsoft .NET Environment I found that quicker with Google than it took you to type out your question. Do yourself a favour and learn to use Google, tri_inn.Alister...

ERROR [HY000] [MySQL][ODBC 3.51 Driver]Can't connect to MySQL server on 'IP Address of the server'(10048) ERROR [HY000] [MySQL][ODBC 3.51 Driver]Can't connect to MySQL server on 'IP of the server' (10
Hi, I am randomly getting the following error message in my application. ERROR [HY000] [MySQL][ODBC 3.51 Driver]Can't connect to MySQL server on 'IP Address of the server'(10048) ERROR [HY000] [MySQL][ODBC 3.51 Driver]Can't connect to MySQL server on 'IP of the server' (10048) I am using .Net 2.0 with VS2005 having ODBC 3.51.14 Driver.  Can any body point out the core reasons of the above error message? Thanks. Nouman Khawaja. I do have the same problem, help me out. Thanks  If the going seems easy, You are going DownHill... When I was writing ...

Problems connecting to MySQL through MyODBC using ODBC.NET
Help ! Another learner... I am trying to connect to mySQL through MyODBC using ODBC.NET and have the following setup on a W2K machine.... 1. mySQL 4.0.15 database up and running (visible in Services). The DB is definitely there (I can see its contents through MySQL CC) 2. I have installed MySQL ODBC 3.51 Driver and created a User DSN called myDSN. I can connect to the database via the 'Test Data Source' (at least its telling me that I've connected...) 3. Using WebMatrix, I have the following declarations in place : <%@ Page Language="VB" Debug="true" Com...

mysql connector NET, web.config database connection
Hey folks!    So, what's my problem? I just started to use MySQL on one project. Database is 5.0.45-community-nt via TCP/IP. I'm using Connector NET 5.1.4 and .NET Framework 2.0. Ok, so I do get MySQL.Data and all from code behind. But I just want to use it like SQL connection, so from web.config. But when I try to do that, my connection just disappears from the list (say when you are choosing connections for datasource of web control). So obviously something is wrong in my web.config declaration of connection string:  <connectionStrings> <add name=&...

Static DB-connection with ado.net/vb/mysql
Hello,my question is if it is possible to create a static connection to a DB.The problem is to connect when the class is loaded the first time and use the same connection for more than one sql statements.i already tried the following:    Shared connection2 = New MySqlConnection("Server = localhost; Database = ee-dok_san; Uid = *****; Pwd = *******'';")How ever when executing for example the following method, I get a mysql-error:the connection must be valid and open.Following would be an example code for a method that inserts data and returns the auto-value:  Public Fun...

connection Mysql C#.net in web.config problem help
 webconfig this code <connectionStrings> <add name="planku" connectionString="Server=localhost;user id=root;password=;database=planku;" providerName="mysql.data.mysqlclient"/></connectionStrings> <system.web><sessionState timeout="60" cookieless="AutoDetect" regenerateExpiredSessionId="true"/> <compilation debug="true" strict="false" explicit="true"><assemblies> <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, Publ...

Changing MySQL connection from .net component to ODBC
Hi there, we've completed our project and managed to run everything smoothly locally. However, when we uploaded all of the files online on our domain, it turns out that the database connection we used from MySQL to ASP.net is NOT SUPPORTED by our host. We are currently using the .net MySQL Component. Our host only supports ODBC connection. We could change all our files and change the lines that uses that .net MySQL component to ODBC, however, that would take so much time that we don't have. Anyone has any suggestions? If no one does then I think it's best to re...

Web resources about - How to kill mysql sleepy connections thru .Net ?? - asp.net.mysql

Connection - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

iMedia Connection: Interactive Marketing News, Features, Podcasts and Video - iMediaConnection.com
If you send more email, you might make more money. Then again, you might destroy your reputation and revenue stream. Here's how to know what ...

HTTP persistent connection - Wikipedia, the free encyclopedia
... tacked on to an existing protocol. If the browser supports keep-alive, it adds an additional header to the request: Following this, the connection ...

MOTHER’S DAY: Facebook Examines Connections Between Moms, Kids
With Mother’s Day on the calendar this coming Sunday, Facebook examined the relationships between mothers and their children on the social network, ...

Kings Cross identities arrested in connection with murder
Two Kings Cross identities&nbsp;have been arrested in connection with the murder of a man at Sydney hotel.

Faith: Spirits lift in connection with home
We need to more adequately understand the spirituality of our unique place on earth.

Governor declares state of emergency in connection with California methane leak
... of Emergency Services) On Wednesday evening, California Governor Jerry Brown declared a state of emergency in Los Angeles County in connection ...

Tons Of Methane Are Spewing Out Of California, And There’s A Connection To The Governor
The out of control leak has forced thousands of residents to flee their homes. Gov. Brown's sister is a paid board member at the company that ...

Report: Man arrested in connection with Ashley Olsen's murder
Italian media agency reports that a non-EU male has been arrested in the murder of the 35-year-old American

Toyota and Kymeta rely on satellites to power this Mirai's data connection
They're hoping to achieve gigabit wireless speeds within the next few years.

Resources last updated: 1/19/2016 9:44:44 PM