Question

How to fix Error Prepare: Waiting for table metadata lock

I have a problem with the MySQL managed database, I am getting the following error: Prepare: Waiting for table metadata lock

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hello,

The waiting for table metadata lock means, that there’s another transaction operating on that table for a long time. 

Using an Account that has the PROCESS privilege you can use the query below to see all the threads running:

You can cancel queries from the MySQL if needed:

SHOW PROCESSLIST;
 or

SHOW FULL PROCESSLIST;

To cancel one of these threads run:
KILL <thread_id>; https://dev.mysql.com/doc/refman/8.0/en/show-processlist.html

Hope that this helps. Regards, Priyanka