Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
#
# Monitor MySQL queries
# @author Colin Mollenhour
file=$(mysql -Be 'SHOW VARIABLES LIKE "general_log_file";' | tail -n 1 | awk '{print $2;}')
echo "SET GLOBAL general_log = 'ON';" | mysql
if [ -w "$file" ]; then
>$file
tail -f $file
<?php
require_once 'abstract.php';
class Mage_Shell_Pricerules extends Mage_Shell_Abstract
{
public function run()
{
ini_set('memory_limit', '1024M');
$this->db = Mage::getSingleton('core/resource')->getConnection('core_read');