Error Code: 1192. Can't execute the given command because you have active locked tables or an active transaction

17,663

Solution 1

It means that the table is exclusively locked and is under transaction. You cannot truncate until it is rollbacked or committed.

For example to unlock tables, see @Cleber Griff's answer.

Solution 2

I solved this problem using SQL query : UNLOCK TABLES;

Share:
17,663
ar em
Author by

ar em

Updated on July 22, 2022

Comments

  • ar em
    ar em almost 2 years

    I am trying to truncate my table on mysql workbench

    truncate pbx_api.confbridges;
    

    but it says

    Error Code: 1192. Can't execute the given command because you have active locked tables or an active transaction