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.
For example to unlock tables, see @Cleber Griff's answer.
I solved this problem using SQL query : UNLOCK TABLES;