12

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
ar em
  • 434
  • 2
  • 5
  • 18

2 Answers2

21

I solved this problem using SQL query : UNLOCK TABLES;

EricLavault
  • 12,130
  • 3
  • 23
  • 45
Cleber Griff
  • 319
  • 2
  • 6
15

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.

EricLavault
  • 12,130
  • 3
  • 23
  • 45
Madhivanan
  • 13,470
  • 1
  • 24
  • 29