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
It means that the table is exclusively locked and is under transaction. You cannot truncate until it is rollbacked or committed.
A session releases all the tables locks with it at once. You can implicitly release the table locks. If the connection to the server terminates explicitly or implicitly all the locks will be released. You can release the locks of a table explicitly using the UNLOCK TABLES statement.
I solved this problem using SQL query : UNLOCK TABLES;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With