vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi, Is there a script or command that I can use on a Windows MySQL server to kill a thread by user id from a remote computer? The vendor application we are using only allows one MySQL thread by a certain user id and if that process hangs we need to manually go into the MySQL Administrator and kill the thread. I would like to automate this if possible. Thanks! Micah |
| |||
| Mooks Wild Pintos <micahvm@yahoo.com> wrote in news:9af5c963-9a52-420a- a568-de7cb2206e37@e1g2000hsh.googlegroups.com: > Hi, > Is there a script or command that I can use on a Windows MySQL server > to kill a thread by user id from a remote computer? The vendor > application we are using only allows one MySQL thread by a certain > user id and if that process hangs we need to manually go into the > MySQL Administrator and kill the thread. I would like to automate > this if possible. I suppose the "if that process hangs" should be of greater concern than trying to automate a thread-kill (which is pretty serious action to be 'automated'). Why would your process hang? That's the question to solve; you shouldn't be experiencing problems on that level without a full inquiry into the cause. |
| |||
| On Dec 3, 10:27 am, Good Man <he...@letsgo.com> wrote: > Mooks Wild Pintos <mica...@yahoo.com> wrote in news:9af5c963-9a52-420a- > a568-de7cb2206...@e1g2000hsh.googlegroups.com: > > > Hi, > > Is there a script or command that I can use on a Windows MySQL server > > to kill a thread by user id from a remote computer? The vendor > > application we are using only allows one MySQL thread by a certain > > user id and if that process hangs we need to manually go into the > > MySQL Administrator and kill the thread. I would like to automate > > this if possible. > > I suppose the "if that process hangs" should be of greater concern than > trying to automate a thread-kill (which is pretty serious action to be > 'automated'). > > Why would your process hang? That's the question to solve; you shouldn't > be experiencing problems on that level without a full inquiry into the > cause. Unfortunately it is a vendor's application and they refuse to fix the issue. The application is used 24x7 and is mission critical so when it hangs and doesn't close correctly I get a late night call to connect to the server and kill the proper thread. So can it be done? If so please let me know and I'll worry about the consequences. |
| |||
| Mooks Wild Pintos <micahvm@yahoo.com> writes: > Is there a script or command that I can use on a Windows MySQL server > to kill a thread by user id from a remote computer? The vendor > application we are using only allows one MySQL thread by a certain > user id and if that process hangs we need to manually go into the > MySQL Administrator and kill the thread. I would like to automate > this if possible. > Thanks! > Micah There are a number of ways you can do it. You can give a SHOW PROCESSLIST -- and then KILL <thread_ID> --- mysql> show processlist; +----+------+-------------------------+---------+---------+------+-------+------------------+ | Id | User | Host | db | Command | Time | State | Info | +----+------+-------------------------+---------+---------+------+-------+------------------+ | 22 | root | nivel.bongojo.com:59005 | bongods | Query | 0 | NULL | show processlist | +----+------+-------------------------+---------+---------+------+-------+------------------+ 1 row in set (0.00 sec) mysql> kill 22; ERROR 2013 (HY000): Lost connection to MySQL server during query ---- Some of the web based tools like phpMyAdmin allow you to administer a server remotely, and provide convenience links to kill processes. Automating it would take some scripting. Depending on what else is on the server you may want to try setting wait_timeout in your my.cnf -- the server will automatically close a connection if it stays idle for too long. That might work real well for you! Hope this helps! -- John __________________________________________________ _________________ John Murtari Software Workshop Inc. jmurtari@following domain 315.635-1968(x-211) "TheBook.Com" (TM) http://thebook.com/ |
| |||
| Mooks Wild Pintos <micahvm@yahoo.com> wrote in news:3e17d10f-be42-4ac6-88bb-d90cab5afdb9@s12g2000prg.googlegroups.com: > On Dec 3, 10:27 am, Good Man <he...@letsgo.com> wrote: >> Mooks Wild Pintos <mica...@yahoo.com> wrote in >> news:9af5c963-9a52-420a- >> a568-de7cb2206...@e1g2000hsh.googlegroups.com: >> >> > Hi, >> > Is there a script or command that I can use on a Windows MySQL >> > server to kill a thread by user id from a remote computer? The >> > vendor application we are using only allows one MySQL thread by a >> > certain user id and if that process hangs we need to manually go >> > into the MySQL Administrator and kill the thread. I would like to >> > automate this if possible. >> >> I suppose the "if that process hangs" should be of greater concern >> than trying to automate a thread-kill (which is pretty serious action >> to be 'automated'). >> >> Why would your process hang? That's the question to solve; you >> shouldn't be experiencing problems on that level without a full >> inquiry into the cause. > > > Unfortunately it is a vendor's application and they refuse to fix the > issue. The application is used 24x7 and is mission critical so when > it hangs and doesn't close correctly I get a late night call to > connect to the server and kill the proper thread. So can it be done? > If so please let me know and I'll worry about the consequences. > I've written a PHP form that allows folks to kill their own sessions. Also if V5 MYSQL you could write a stored procedure to pull the trigger. |
| ||||
| == Quote from Ana C. Dent (anacedent@hotmail.com)'s article > Mooks Wild Pintos <micahvm@yahoo.com> wrote in > news:3e17d10f-be42-4ac6-88bb-d90cab5afdb9@s12g2000prg.googlegroups.com: > > On Dec 3, 10:27 am, Good Man <he...@letsgo.com> wrote: > >> Mooks Wild Pintos <mica...@yahoo.com> wrote in > >> news:9af5c963-9a52-420a- > >> a568-de7cb2206...@e1g2000hsh.googlegroups.com: > >> > >> > Hi, > >> > Is there a script or command that I can use on a Windows MySQL > >> > server to kill a thread by user id from a remote computer? The > >> > vendor application we are using only allows one MySQL thread by a > >> > certain user id and if that process hangs we need to manually go > >> > into the MySQL Administrator and kill the thread. I would like to > >> > automate this if possible. > >> > >> I suppose the "if that process hangs" should be of greater concern > >> than trying to automate a thread-kill (which is pretty serious action > >> to be 'automated'). > >> > >> Why would your process hang? That's the question to solve; you > >> shouldn't be experiencing problems on that level without a full > >> inquiry into the cause. > > > > > > Unfortunately it is a vendor's application and they refuse to fix the > > issue. The application is used 24x7 and is mission critical so when > > it hangs and doesn't close correctly I get a late night call to > > connect to the server and kill the proper thread. So can it be done? > > If so please let me know and I'll worry about the consequences. > > > I've written a PHP form that allows folks to kill their own sessions. > Also if V5 MYSQL you could write a stored procedure to pull the trigger. you don't need any of these. they are nice to have but to kill a user session, you can use mysql administrator gui program. after login, click on the connections and then click on the "by user" tab. see if you can use this. -- POST BY: lark with PHP News Reader ;o) |