Is there a way to find out what sql queries were run during a drush pm-uninstall module? The reason I want to find out is because I want to see if certain tables were removed during the uninstall. Sometimes modules like ubercart leave orphaned tables even though you uninstall them. I had to find the hard way after installing and testing a few other modules and see my database tables balloon up.

  • I would look at devels query log and them figure out of there's a way to enable it during drush calls. It's my understanding that anything created with a proper hook_schema will always be removed during uninstall. Otherwise you've got a core bug.
    – Letharion
    Jun 11, 2013 at 15:48

1 Answer 1


You could try to adapt the devel query log as Letharion suggested, but that would involve some coding. I have done similar things (for a different purpose) by using the Mysql General Query Log. This requires restarting mysqld with an additional parameter, but beyond that minor inconvenience, works pretty well and shows you absolutely everything that's going on with the database.

  • do you have a screenshot of how that would look? And if I turn it on in my production, would it affect performance? thanks greg! Jun 11, 2013 at 17:15
  • Don't turn it on in production! It logs a lot, so performance and space are significantly impacted. Don't leave it on for very long. I haven't had this enabled for a long time, so I don't have screenshots, but it basically produces a log file full of SQL queries. Jun 11, 2013 at 17:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.