Sample Header Ad - 728x90

Log to disk all queries that waited for a lock over a period of time

0 votes
1 answer
153 views
I manage a mariadb 10.4.17 server, and I'm having the issues with a table, it seems randomly I will get lots of queries "waiting for metadata lock" causing my entire database to be useless. I usually have to restart my server to get the database running again. I'm looking for methods that can consistently log to disk all the queries who can use problems, without affecting performance too much. I like something like this > watch -n 0.5 'mysqladmin -u root -ppassword "processlist"' > log.txt But I don't know how to order by state. Anyway I'm open to any ideas. Looking for something I can look at to see what happened in the past because when the issue happens I just want to restart the db to get back online asap and don't have time to dig the root of the issue
Asked by Freedo (208 rep)
Jan 17, 2021, 10:19 AM
Last activity: Jul 18, 2025, 11:10 PM