Skip to content Skip to sidebar Skip to footer

Mysql Query Locking Tables

Hi Is there a way of checking which query is locking tables in mysql? We can Identify which tables are locked however Its difficult to find the query that is locking tables. We hav

Solution 1:

If you have root access to mysql service:

#mysql -uroot
#mysql>SETglobal log_output ='table';
#mysql>SETglobal general_log =1;

reload site or do something that locks table

#mysql>SETglobal general_log =0;

And next inspect table mysql.general_log

If you haven't root access to mysql service set in root/lib/Varien/Db/Adapter/Pdo/Mysql.php:

protected$_debug = true;
protected$_logAllQueries = true;

After reload page you'll get query log in var/debug/pdo_mysql.log

Solution 2:

I might be missing something here, but "SHOW PROCESS LIST" DOES show you the query that's locking the table, although not show you the full query.

If you want to see the full query, you must execute "SHOW FULL PROCESS LIST".

If this does not help you please provide more info (or perhaps my english need some polish and did not understand the question).

EDIT: some grammar

Post a Comment for "Mysql Query Locking Tables"