<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://briansnelson.com/index.php?action=history&amp;feed=atom&amp;title=Enable_Mysql_Slow_Query_Logging</id>
		<title>Enable Mysql Slow Query Logging - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://briansnelson.com/index.php?action=history&amp;feed=atom&amp;title=Enable_Mysql_Slow_Query_Logging"/>
		<link rel="alternate" type="text/html" href="https://briansnelson.com/index.php?title=Enable_Mysql_Slow_Query_Logging&amp;action=history"/>
		<updated>2026-06-04T08:59:27Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.24.1</generator>

	<entry>
		<id>https://briansnelson.com/index.php?title=Enable_Mysql_Slow_Query_Logging&amp;diff=109&amp;oldid=prev</id>
		<title>Brian: Created page with &quot;=Enable Mysql Slow Query Logigng/Mysql Query Logging=  Are you having mysql problems with your Magento installation.  Did you know you can enable mysql logging directly from w...&quot;</title>
		<link rel="alternate" type="text/html" href="https://briansnelson.com/index.php?title=Enable_Mysql_Slow_Query_Logging&amp;diff=109&amp;oldid=prev"/>
				<updated>2013-09-21T08:20:14Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;=Enable Mysql Slow Query Logigng/Mysql Query Logging=  Are you having mysql problems with your Magento installation.  Did you know you can enable mysql logging directly from w...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=Enable Mysql Slow Query Logigng/Mysql Query Logging=&lt;br /&gt;
&lt;br /&gt;
Are you having mysql problems with your Magento installation.  Did you know you can enable mysql logging directly from within Magento?  Let talk about enabling database logging with Magento.&lt;br /&gt;
&lt;br /&gt;
You can enable this feature in your Mysql.php file.&lt;br /&gt;
&lt;br /&gt;
 vim lib/Varien/Db/Adapter/Pdo/Mysql.php&lt;br /&gt;
&lt;br /&gt;
Are you looking to enable slow log querying or log all queries?&lt;br /&gt;
&lt;br /&gt;
==Enable Slow Log Querying in Magento==&lt;br /&gt;
&lt;br /&gt;
Change&lt;br /&gt;
 protected $_debug = true;&lt;br /&gt;
 protected $_logQueryTime = 0.05  // Change to what you consider slow&lt;br /&gt;
 protected $_logAllQueries = false; // Must be false or it logs everything&lt;br /&gt;
 protected $_debugFile = 'var/debug/pdo_mysql.log';&lt;br /&gt;
&lt;br /&gt;
==Enable Mysql Querying in Magento==&lt;br /&gt;
&lt;br /&gt;
Change&lt;br /&gt;
 protected $_debug = true;&lt;br /&gt;
 protected $_logAllQueries = true;&lt;br /&gt;
 protected $_debugFile = 'var/debug/pdo_mysql.log';&lt;br /&gt;
&lt;br /&gt;
Just remember to turn this feature off once your done, as it will eat up your disk space in a hurry.&lt;br /&gt;
&lt;br /&gt;
Another field you can change is the callstack this will help determine what is making the database call.&lt;br /&gt;
&lt;br /&gt;
 protected $_logCallStack = true;&lt;br /&gt;
&lt;br /&gt;
Also, while debugging to help narrow down the issue, you should disable the site from outside visitors.&lt;br /&gt;
&lt;br /&gt;
===Disable Access to Your Magento Store===&lt;br /&gt;
&lt;br /&gt;
Add the following to the top of your .htaccess file.&lt;br /&gt;
&lt;br /&gt;
 Order deny,allow&lt;br /&gt;
 Deny from all&lt;br /&gt;
 Allow from &amp;lt;youripaddress&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Happy Magento Debugging&lt;/div&gt;</summary>
		<author><name>Brian</name></author>	</entry>

	</feed>