Re: [sqlalchemy] How to kill a MySQL process on keyboard Interrupt?

2019-11-14 Thread Marcin Koziej
‐‐‐ Original Message ‐‐‐ On Thursday, November 14, 2019 3:22 PM, Mike Bayer wrote: > that's the driver you're using which would not be allowing keyboard interrupt > to go through. > > I just tried this with mysqlclient and pymysql and I would assume you're > using mysqlclient as it

Re: [sqlalchemy] How to kill a MySQL process on keyboard Interrupt?

2019-11-14 Thread Mike Bayer
On Thu, Nov 14, 2019, at 3:24 AM, Marcin Koziej wrote: > (Crossposting from Stackoverflow, where I unfortunately didn't get any > answers: > https://stackoverflow.com/questions/58837864/sqlalchemty-how-to-kill-a-mysql-process-on-keyboard-interrupt > ) > > Hello! > > I'm using SQLAlchemy

Re: [sqlalchemy] How to kill a MySQL process on keyboard Interrupt?

2019-11-14 Thread Marcin Koziej
Wow! Thank You so much for pointing me these! --  Marcin Koziej GPG key: https://go.cahoots.pl/gpg/  Ϟ  Twitter: @movonw ‐‐‐ Original Message ‐‐‐ On Thursday, November 14, 2019 2:31 PM, Simon King wrote: > For what it's worth, you can read how the mysql command line does it here: > >

Re: [sqlalchemy] How to kill a MySQL process on keyboard Interrupt?

2019-11-14 Thread Simon King
For what it's worth, you can read how the mysql command line does it here: https://github.com/mysql/mysql-server/blob/8.0/client/mysql.cc#L1484 On Thu, Nov 14, 2019 at 1:21 PM Simon King wrote: > > According to >

Re: [sqlalchemy] How to kill a MySQL process on keyboard Interrupt?

2019-11-14 Thread Simon King
According to https://dev.mysql.com/doc/refman/8.0/en/information-functions.html#function_connection-id, "SELECT connection_id()" should give you the answer. Simon On Thu, Nov 14, 2019 at 12:13 PM Marcin Koziej wrote: > > I don't know how to do this using other DBAPIs, but I thought that if

Re: [sqlalchemy] How to kill a MySQL process on keyboard Interrupt?

2019-11-14 Thread Marcin Koziej
I don't know how to do this using other DBAPIs, but I thought that if command line mysql client has such behaviour, it should be possible also using the library. I was thinking about finding the process in SHOW PROCESSLIST and killing it, but it seems hacky and I am not sure if I can find the

Re: [sqlalchemy] How to kill a MySQL process on keyboard Interrupt?

2019-11-14 Thread Simon King
I'm not sure this is even possible. Ignoring SQLAlchemy, do you know how you would do it using any MySQL DBAPI library (mysqlclient, PyMySQL, etc.)? Maybe you could do something creative where you capture the PID when the connection is created, and on Ctrl-C, send a "KILL pid" command. I don't

[sqlalchemy] How to kill a MySQL process on keyboard Interrupt?

2019-11-14 Thread Marcin Koziej
(Crossposting from Stackoverflow, where I unfortunately didn't get any answers: https://stackoverflow.com/questions/58837864/sqlalchemty-how-to-kill-a-mysql-process-on-keyboard-interrupt ) Hello! I'm using SQLAlchemy 1.3.10 to run a bunch of SQL statements on Percona Server 5.7.27. I do not