Display open transactions in MySQL

后端 未结 4 2078
后悔当初
后悔当初 2020-12-02 12:55

I did some queries without a commit. Then the application was stopped.

How can I display these open transactions and commit or cancel them?

4条回答
  •  盖世英雄少女心
    2020-12-02 13:13

    Although there won't be any remaining transaction in the case, as @Johan said, you can see the current transaction list in InnoDB with the query below if you want.

    SELECT * FROM information_schema.innodb_trx\G

    From the document:

    The INNODB_TRX table contains information about every transaction (excluding read-only transactions) currently executing inside InnoDB, including whether the transaction is waiting for a lock, when the transaction started, and the SQL statement the transaction is executing, if any.

提交回复
热议问题