Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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
like image 990
ar em Avatar asked Jul 28 '15 06:07

ar em


People also ask

Can't execute the given command because you have active locked tables?

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

How do I unlock a locked table in mysql?

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.


1 Answers

I solved this problem using SQL query : UNLOCK TABLES;

like image 127
Cleber Griff Avatar answered Nov 03 '22 00:11

Cleber Griff