<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>slow_query_log &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/slow_query_log/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbrnd.com</link>
	<description>BIGData &#124; NoSQL &#124; MSSQL &#124; MySQL &#124; PostgreSQL</description>
	<lastBuildDate>Tue, 19 Sep 2017 11:22:42 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.6</generator>
	<item>
		<title>MySQL: How to Log General and Long Running Queries into Log Table</title>
		<link>https://www.dbrnd.com/2015/11/mysql-how-to-log-general-and-long-running-queries-into-log-table/</link>
					<comments>https://www.dbrnd.com/2015/11/mysql-how-to-log-general-and-long-running-queries-into-log-table/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sun, 15 Nov 2015 16:08:52 +0000</pubDate>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[MySQL DBA Script]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[general_log]]></category>
		<category><![CDATA[log_output]]></category>
		<category><![CDATA[log_queries_not_using_indexes]]></category>
		<category><![CDATA[long_query_time]]></category>
		<category><![CDATA[MySQL Command]]></category>
		<category><![CDATA[MySQL Database Administrator]]></category>
		<category><![CDATA[MySQL Database Designing]]></category>
		<category><![CDATA[MySQL Database Programming]]></category>
		<category><![CDATA[MySQL Error]]></category>
		<category><![CDATA[MySQL Performance Tunning]]></category>
		<category><![CDATA[MySQL Query]]></category>
		<category><![CDATA[MySQL Tips and Tricks]]></category>
		<category><![CDATA[slow_query_log]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=975</guid>

					<description><![CDATA[In this post, I am sharing the different parameters to enable logging for General and Long running queries in MySQL. Using shared approach, you don&#8217;t require to restart your MySQL Server. You can easily configure this log parameter, and you can see the output in Log table. As a Database Administrator, it is our responsibility [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F11%2Fmysql-how-to-log-general-and-long-running-queries-into-log-table%2F&amp;linkname=MySQL%3A%20How%20to%20Log%20General%20and%20Long%20Running%20Queries%20into%20Log%20Table" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F11%2Fmysql-how-to-log-general-and-long-running-queries-into-log-table%2F&amp;linkname=MySQL%3A%20How%20to%20Log%20General%20and%20Long%20Running%20Queries%20into%20Log%20Table" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F11%2Fmysql-how-to-log-general-and-long-running-queries-into-log-table%2F&amp;linkname=MySQL%3A%20How%20to%20Log%20General%20and%20Long%20Running%20Queries%20into%20Log%20Table" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F11%2Fmysql-how-to-log-general-and-long-running-queries-into-log-table%2F&amp;linkname=MySQL%3A%20How%20to%20Log%20General%20and%20Long%20Running%20Queries%20into%20Log%20Table" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F11%2Fmysql-how-to-log-general-and-long-running-queries-into-log-table%2F&amp;linkname=MySQL%3A%20How%20to%20Log%20General%20and%20Long%20Running%20Queries%20into%20Log%20Table" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F11%2Fmysql-how-to-log-general-and-long-running-queries-into-log-table%2F&amp;linkname=MySQL%3A%20How%20to%20Log%20General%20and%20Long%20Running%20Queries%20into%20Log%20Table" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2015%2F11%2Fmysql-how-to-log-general-and-long-running-queries-into-log-table%2F&#038;title=MySQL%3A%20How%20to%20Log%20General%20and%20Long%20Running%20Queries%20into%20Log%20Table" data-a2a-url="https://www.dbrnd.com/2015/11/mysql-how-to-log-general-and-long-running-queries-into-log-table/" data-a2a-title="MySQL: How to Log General and Long Running Queries into Log Table"></a></p><p>In this post, I am sharing the different parameters to enable logging for General and Long running queries in MySQL.</p>
<p>Using shared approach, you don&#8217;t require to restart your MySQL Server. You can easily configure this log parameter, and you can see the output in Log table.</p>
<p>As a Database Administrator, it is our responsibility to log the all different kinds of queries because the log is our primary requirement for any troubleshooting.</p>
<p><strong>First check the current status of the different Log Parameters:</strong></p>
<pre class="crayon-plain-tag">SHOW VARIABLES LIKE '%log%';</pre> </p>
<p>Using above statement, you can check the current value of log parameter. </p>
<p><strong>Now enable logging for general query and save the output into &#8220;mysql.general_log&#8221; table:</strong></p>
<pre class="crayon-plain-tag">SET GLOBAL log_output = 'TABLE';
SET GLOBAL general_log = 'ON';
SELECT *FROM mysql.general_log;</pre> </p>
<p><strong>Now enable logging for long running queries:</strong></p>
<pre class="crayon-plain-tag">SET GLOBAL slow_query_log = 1;
SET GLOBAL long_query_time= 1;
SET GLOBAL log_queries_not_using_indexes= ON;</pre> </p>
<p><strong>Sometimes, it is required to execute the FLUSH command of the log to get immediate updates into the Log Table.<br />
</strong></p>
<pre class="crayon-plain-tag">FLUSH LOGS;</pre> </p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2015/11/mysql-how-to-log-general-and-long-running-queries-into-log-table/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
	</channel>
</rss>
