<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>egloo &#187; database</title>
	<atom:link href="http://egloo.wordpress.com/tag/database/feed/" rel="self" type="application/rss+xml" />
	<link>http://egloo.wordpress.com</link>
	<description>Linux Sysadmin Blog</description>
	<lastBuildDate>Sat, 18 Apr 2009 19:35:52 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='egloo.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/4f738d3a8dae6c0af9ecb7fb5c48f4a5?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>egloo &#187; database</title>
		<link>http://egloo.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://egloo.wordpress.com/osd.xml" title="egloo" />
		<item>
		<title>How to Read MySQL Binary Logs</title>
		<link>http://egloo.wordpress.com/2008/11/19/how-to-read-mysql-binary-logs/</link>
		<comments>http://egloo.wordpress.com/2008/11/19/how-to-read-mysql-binary-logs/#comments</comments>
		<pubDate>Wed, 19 Nov 2008 01:26:25 +0000</pubDate>
		<dc:creator>pcabrerat</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://egloo.wordpress.com/?p=221</guid>
		<description><![CDATA[MySQL database server utilizes a transaction log to track all of the modifications performed within the databases. This log ensures both that the database is able to recover when abruptly interrupted (such as a loss of power) and that users are able to undo (or &#8220;rollback&#8221; in database language) the results of a database transaction. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=egloo.wordpress.com&blog=4102430&post=221&subd=egloo&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><img class="alignleft size-full wp-image-223" title="mysqllogo" src="http://egloo.files.wordpress.com/2008/11/mysqllogo.png?w=213&#038;h=111" alt="mysqllogo" width="213" height="111" />MySQL database server utilizes a <a href="http://en.wikipedia.org/wiki/Binary_log">transaction log</a> to track all of the modifications performed within the databases. This log ensures both that the database is able to recover when abruptly interrupted (such as a loss of power) and that users are able to undo (or &#8220;rollback&#8221; in database language) the results of a database transaction. Except for the cases where the administrator has disabled or commented out the<strong> log-bin</strong> parameter in <strong>my.cfg</strong> file, this log is generated by default. As the name implies, binary log (transaction log) files are written in binary format, but sometimes you may need to examine the content of the transaction logs in text format, where the mysqlbinlog utility will come in handy.</p>
<p>A binlog file normally is named<strong> hostname-bin.xxxxx</strong> and stored in <code>/var/lib/mysql</code> directory. It cannot be opened and read straight away as it’s a binary file so we can make use of <code>mysqlbinlog </code>command.</p>
<p>For example, to display the contents of the binary log file named <strong>localhost-bin.000004</strong>, use this command:</p>
<p><code>mysqlbinlog localhost-bin.000004</code></p>
<p>The output includes all events contained in <strong>localhost-bin.000004</strong>. Event information includes the statement executed, the time the statement took, the thread ID of the client that issued it, the timestamp when it was executed, and so forth.</p>
<p>The binlogs are likely to be very huge thus making it almost impossible to read anything on screen. However, you can pipe the output into a file which can be open up for later browsing in text editor:</p>
<p><code>mysqlbinlog localhost-bin.000004 &gt; filename.txt</code></p>
<p>To reduce the amount of data retrieved from binary logs, there are several options that can be used to limit the data that is been returned. Among the useful ones are listed below:</p>
<p><code>–start-datetime=[DATETIME]</code></p>
<p><code>–stop-datetime=[DATETIME]</code></p>
<p>The <em>datetime</em> value is relative to the local time zone on the machine where you run <code>mysqlbinlog</code>. The value should be in a format accepted for the <strong>DATETIME</strong> or <strong>TIMESTAMP</strong> data types. For example:</p>
<p><code>mysqlbinlog --start-datetime="2008-05-22 00:00:00" --stop-datetime="2008-05-29 00:00:00" localhost-bin.000004</code></p>
<p>For more information, you can take a look at the official mysqlbinlog <a href="http://dev.mysql.com/doc/refman/5.0/en/mysqlbinlog.html">documentation</a>.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/egloo.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/egloo.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/egloo.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/egloo.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/egloo.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/egloo.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/egloo.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/egloo.wordpress.com/221/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/egloo.wordpress.com/221/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/egloo.wordpress.com/221/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=egloo.wordpress.com&blog=4102430&post=221&subd=egloo&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://egloo.wordpress.com/2008/11/19/how-to-read-mysql-binary-logs/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">pcabrerat</media:title>
		</media:content>

		<media:content url="http://egloo.files.wordpress.com/2008/11/mysqllogo.png" medium="image">
			<media:title type="html">mysqllogo</media:title>
		</media:content>
	</item>
	</channel>
</rss>