I am trying to run a simple query. The query is quite simple but the dataset is large. The query is trying to select all the text that contains specific word and then deleting that row. I am getting the following error.
Error Code: 1205. Lock wait timeout exceeded; try restarting transaction
I am using MySQL workbench for my convenience. I am not very familiar with MySQL. I would appreciate any help.
DELETE FROM tables WHERE row_names IN (
SELECT * FROM (
SELECT row_names FROM tables WHERE text like "%beer%"
) AS p
)
I ran this query before too and it worked fine.