Home > other >  Unable to kill Mysql transaction
Unable to kill Mysql transaction

Time:06-09

I started a transaction in a PHP file with the mysqli_begin_transaction() and had an Exception before committing the transaction. The transaction is therefore not committed nor rolledback. I have tried to kill the transaction by using the kill <id> command, but I get a Unknown thread id: <id> error. I got the Id by using the SHOW FULL PROCESSLIST; and it seems like the id changes everytime I re-run this query. I have also tried to get all the Process's for the "root" user (the user I used to create this transaction), and delete them, but I have the same problem. I get the Unknown thread id: <id> error. I also get a different Id each time using this method as well. This is the code I used to get the Id's for the root user:

Select concat('KILL ',id,';') from information_schema.processlist where user='user';

I'm using Mysql, Engine=InnoDB with phpMyAdmin.

CodePudding user response:

The original transaction that you wanted to kill is long dead.

If the thread id is changing, then it's not the same transaction. It's many new transactions, probably started by subsequent PHP requests, and they are are short-lived, which is why they say "unknown thread id" by the time you issue a KILL.

  • Related