<?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>My Learnings - Markish Personal Blog &#187; Database</title>
	<atom:link href="http://markish.in/category/technology/database/feed/" rel="self" type="application/rss+xml" />
	<link>http://markish.in</link>
	<description>It&#039;s my Blog....!</description>
	<lastBuildDate>Thu, 10 Mar 2011 08:41:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Implementing Output Caching in PHP &#8211; Solve Perfomance Issues</title>
		<link>http://markish.in/2010/12/implementing-output-caching-in-php-solve-perfomance-issues/</link>
		<comments>http://markish.in/2010/12/implementing-output-caching-in-php-solve-perfomance-issues/#comments</comments>
		<pubDate>Sat, 18 Dec 2010 09:26:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Internet Technology]]></category>
		<category><![CDATA[PHP & Mysql]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Caching with PHP]]></category>
		<category><![CDATA[Data Caching]]></category>
		<category><![CDATA[Output caching]]></category>
		<category><![CDATA[Record set Caching]]></category>
		<category><![CDATA[Tutorial for Caching in PHP]]></category>

		<guid isPermaLink="false">http://markish.in/?p=162</guid>
		<description><![CDATA[Cache by definition is transparent storage where results can be stored, so that the future requests can be served faster. With the amount of data handled ever growing, and the necessity for caching has become unavoidable in any decent size web application. In this series, I&#8217;d try to bring out various alternatives available in PHP [...]]]></description>
			<content:encoded><![CDATA[<p>Cache by definition is transparent storage where results can be stored, so that the future requests can be served faster. With the amount of data handled ever growing, and the necessity for caching has become unavoidable in any decent size web application. In this series, I&#8217;d try to bring out various alternatives available in PHP for efficient caching.<br />
<span id="more-162"></span><br />
Before going further, let me explain what is caching &amp; types of caching. Caching can be implemented in server-side as well as browser-side or the client-side. The server-side caching itself can be implemented using various techniques &#8211; viz. HTML caching, Data caching. Each method involves storing the whole or part of the resultant data generated at the web sever in some physical medium and accessing it again for the future requests.</p>
<p>The validity of the data present in the cache depends on the implementation logic and hugely depends on the nature of the application itself. For example, In an online store, the cache data containing the list of products available in the store can be valid for even 2 hours as there is very less chance of a product being added every 2 hours. But the cache data holding the availability (stock) of products can be valid for probably 2 minutes ( assuming , it&#8217;s a real online store where business happens) as the availability keeps changing.</p>
<p>Today we&#8217;d talk about one of the techniques in output caching &#8211; Record set caching. It&#8217;s one of the straight forward approach, that can be implemented. In layman terms, The record-set after a complicated query would be stored separately so that, the future requests can be served from the temporary storage instead of running the time consuming complicated query again every time.</p>
<p>To start with, Let us consider an example. A page delivering search results in JSON format from a product catalogue accepting a search query. Let us put down the algorithm to implement this</p>
<p>Step 1 : Check if a valid cache data exists in cache<br />
Step 2 : If Yes read, the cache data and serve it to the user / client<br />
Step 3 : If No, Read it from the DB and serve the user.<br />
Step 4 : Update / Create the valid cache data with the one got in step 3</p>
<p>Let&#8217;s get into coding rightaway..<br />
<div id="wpshdo_1" class="wp-synhighlighter-outer"><div id="wpshdt_1" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_1"></a><a id="wpshat_1" class="wp-synhighlighter-title" href="#codesyntax_1"  onClick="javascript:wpsh_toggleBlock(1)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_1" onClick="javascript:wpsh_code(1)" title="Show code only"><img border="0" style="border: 0 none" src="http://markish.in/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_1" onClick="javascript:wpsh_print(1)" title="Print code"><img border="0" style="border: 0 none" src="http://markish.in/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://markish.in/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://markish.in/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_1" class="wp-synhighlighter-inner" style="display: block;"><pre class="php" style="font-family:monospace;"><span class="re0">$mcdir</span> <span class="sy0">=</span> <span class="st0">&quot;cache/&quot;</span><span class="sy0">;</span>
<span class="re0">$mcache_validity</span><span class="sy0">=</span><span class="nu0">10</span><span class="sy0">;</span>
<span class="re0">$mfnam</span> <span class="sy0">=</span> <span class="re0">$mcdir</span> <span class="sy0">.</span> <span class="st0">&quot;ch_&quot;</span> <span class="sy0">.</span> <span class="re0">$search_data</span> <span class="sy0">.</span><span class="st0">&quot;_file.txt&quot;</span><span class="sy0">;</span>
<span class="re0">$mread_from_cache</span> <span class="sy0">=</span> <span class="kw4">false</span><span class="sy0">;</span>
<span class="kw1">if</span> <span class="br0">&#40;</span><a href="http://www.php.net/file_exists"><span class="kw3">file_exists</span></a><span class="br0">&#40;</span><span class="re0">$mfnam</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
	<span class="re0">$mctime</span> <span class="sy0">=</span> <span class="br0">&#40;</span><a href="http://www.php.net/filectime"><span class="kw3">filectime</span></a><span class="br0">&#40;</span><span class="re0">$mfnam</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
	<span class="re0">$mtime_offset</span> <span class="sy0">=</span> <a href="http://www.php.net/time"><span class="kw3">time</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="sy0">-</span> <span class="re0">$mctime</span><span class="sy0">;</span>
	<span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$mtime_offset</span> <span class="sy0">&lt;</span> <span class="re0">$mcache_validity</span> <span class="sy0">*</span> 60<span class="br0">&#41;</span> <span class="br0">&#123;</span>
		<span class="re0">$mread_from_cache</span> <span class="sy0">=</span> <span class="kw4">true</span><span class="sy0">;</span>
	<span class="br0">&#125;</span>
<span class="br0">&#125;</span></pre></div></div></p>
<p>In the above code snippet , we just check if there is a valid cache data available. The logic behind is to have a separate file to store the result-set for individual search strings. I&#8217;ve set the validity of the cache data to 10 minutes. The next step would be based on the decision made in <strong>step-1</strong></p>
<div id="wpshdo_2" class="wp-synhighlighter-outer"><div id="wpshdt_2" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_2"></a><a id="wpshat_2" class="wp-synhighlighter-title" href="#codesyntax_2"  onClick="javascript:wpsh_toggleBlock(2)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_2" onClick="javascript:wpsh_code(2)" title="Show code only"><img border="0" style="border: 0 none" src="http://markish.in/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_2" onClick="javascript:wpsh_print(2)" title="Print code"><img border="0" style="border: 0 none" src="http://markish.in/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://markish.in/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://markish.in/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_2" class="wp-synhighlighter-inner" style="display: block;"><pre class="php" style="font-family:monospace;"><span class="kw1">if</span> <span class="br0">&#40;</span><span class="sy0">!</span><span class="re0">$mread_from_cache</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
    <span class="re0">$msql</span> <span class="sy0">=</span> <span class="st0">&quot;select product_id,product_name,product_img,product_desc,product_rate
            from product_master where product_name like '%<span class="es4">$search_data</span>%'
            where flag_dele=0&quot;</span><span class="sy0">;</span>
    <span class="re0">$mres</span> <span class="sy0">=</span> <a href="http://www.php.net/mysql_query"><span class="kw3">mysql_query</span></a><span class="br0">&#40;</span><span class="re0">$msql</span><span class="br0">&#41;</span><span class="sy0">;</span>
    <span class="re0">$mresult</span> <span class="sy0">=</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
    <span class="kw1">while</span> <span class="br0">&#40;</span><span class="re0">$mdata</span> <span class="sy0">=</span> <a href="http://www.php.net/mysql_fetch_object"><span class="kw3">mysql_fetch_object</span></a><span class="br0">&#40;</span><span class="re0">$mres</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
        <span class="re0">$mresult</span><span class="br0">&#91;</span><span class="br0">&#93;</span> <span class="sy0">=</span> <span class="re0">$mdata</span><span class="sy0">;</span>
    <span class="br0">&#125;</span>
    <span class="re0">$cacheData</span> <span class="sy0">=</span> readCache<span class="br0">&#40;</span><span class="re0">$mfnam</span><span class="br0">&#41;</span><span class="sy0">;</span>
    <span class="br0">&#40;</span><a href="http://www.php.net/md5"><span class="kw3">md5</span></a><span class="br0">&#40;</span><a href="http://www.php.net/serialize"><span class="kw3">serialize</span></a><span class="br0">&#40;</span><span class="re0">$cacheData</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="sy0">==</span> <a href="http://www.php.net/md5"><span class="kw3">md5</span></a><span class="br0">&#40;</span><a href="http://www.php.net/serialize"><span class="kw3">serialize</span></a><span class="br0">&#40;</span><span class="re0">$data</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> ? <span class="re0">$data</span> <span class="sy0">=</span> <span class="re0">$cacheData</span> <span class="sy0">:</span> writeCache<span class="br0">&#40;</span><span class="re0">$data</span><span class="sy0">,</span> <span class="re0">$mfnam</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span><span class="kw1">else</span><span class="br0">&#123;</span>
    <span class="re0">$mresult</span> <span class="sy0">=</span> readCache<span class="br0">&#40;</span><span class="re0">$mfnam</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span>
<span class="kw1">echo</span> <a href="http://www.php.net/json_encode"><span class="kw3">json_encode</span></a><span class="br0">&#40;</span><span class="re0">$mresult</span><span class="br0">&#41;</span><span class="sy0">;</span>
<a href="http://www.php.net/flush"><span class="kw3">flush</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></pre></div></div>
<p>In the above code, we based on the value of &#8216;<em>$mread_from_cache</em>&#8216; , either read from the database or from the cache data. I&#8217;ve got a simple query for illustration. It may not be the case in an application. Here we have used two user defined function, one to write and other to read from the cache. The below is the code for them.</p>
<div id="wpshdo_3" class="wp-synhighlighter-outer"><div id="wpshdt_3" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_3"></a><a id="wpshat_3" class="wp-synhighlighter-title" href="#codesyntax_3"  onClick="javascript:wpsh_toggleBlock(3)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_3" onClick="javascript:wpsh_code(3)" title="Show code only"><img border="0" style="border: 0 none" src="http://markish.in/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_3" onClick="javascript:wpsh_print(3)" title="Print code"><img border="0" style="border: 0 none" src="http://markish.in/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://markish.in/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://markish.in/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_3" class="wp-synhighlighter-inner" style="display: block;"><pre class="php" style="font-family:monospace;"><ol><li class="li1"><div class="de1"><span class="kw2">function</span> writeCache<span class="br0">&#40;</span><span class="re0">$data</span><span class="sy0">,</span> <span class="re0">$cacheFile</span><span class="sy0">=</span><span class="st_h">'default_cache.txt'</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">    <span class="kw1">if</span> <span class="br0">&#40;</span><span class="sy0">!</span><span class="re0">$fp</span> <span class="sy0">=</span> <a href="http://www.php.net/fopen"><span class="kw3">fopen</span></a><span class="br0">&#40;</span><span class="re0">$cacheFile</span><span class="sy0">,</span> <span class="st_h">'w'</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">        <a href="http://www.php.net/trigger_error"><span class="kw3">trigger_error</span></a><span class="br0">&#40;</span><span class="st_h">'Error opening cache file'</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1">        <a href="http://www.php.net/exit"><span class="kw3">exit</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li2"><div class="de2">    <span class="br0">&#125;</span></div></li><li class="li1"><div class="de1">    <span class="kw1">if</span> <span class="br0">&#40;</span><span class="sy0">!</span><a href="http://www.php.net/flock"><span class="kw3">flock</span></a><span class="br0">&#40;</span><span class="re0">$fp</span><span class="sy0">,</span> LOCK_EX<span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">        <a href="http://www.php.net/trigger_error"><span class="kw3">trigger_error</span></a><span class="br0">&#40;</span><span class="st_h">'Unable to lock file'</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1">        <a href="http://www.php.net/exit"><span class="kw3">exit</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1">    <span class="br0">&#125;</span></div></li><li class="li2"><div class="de2">    <span class="kw1">if</span> <span class="br0">&#40;</span><span class="sy0">!</span><a href="http://www.php.net/fwrite"><span class="kw3">fwrite</span></a><span class="br0">&#40;</span><span class="re0">$fp</span><span class="sy0">,</span> <a href="http://www.php.net/serialize"><span class="kw3">serialize</span></a><span class="br0">&#40;</span><span class="re0">$data</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">        <a href="http://www.php.net/trigger_error"><span class="kw3">trigger_error</span></a><span class="br0">&#40;</span><span class="st_h">'Error writing to cache file'</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1">        <a href="http://www.php.net/exit"><span class="kw3">exit</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1">    <span class="br0">&#125;</span></div></li><li class="li1"><div class="de1">    <a href="http://www.php.net/flock"><span class="kw3">flock</span></a><span class="br0">&#40;</span><span class="re0">$fp</span><span class="sy0">,</span> LOCK_UN<span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li2"><div class="de2">    <a href="http://www.php.net/fclose"><span class="kw3">fclose</span></a><span class="br0">&#40;</span><span class="re0">$fp</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1"><span class="br0">&#125;</span></div></li><li class="li1"><div class="de1">&nbsp;</div></li><li class="li1"><div class="de1"><span class="kw2">function</span> readCache<span class="br0">&#40;</span><span class="re0">$cacheFile</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li><li class="li1"><div class="de1">    <span class="kw1">if</span> <span class="br0">&#40;</span><span class="sy0">!</span><a href="http://www.php.net/file_exists"><span class="kw3">file_exists</span></a><span class="br0">&#40;</span><span class="re0">$cacheFile</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li><li class="li2"><div class="de2">        <span class="kw1">return</span> <span class="st_h">''</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1">    <span class="br0">&#125;</span></div></li><li class="li1"><div class="de1">    <span class="kw1">return</span> <a href="http://www.php.net/unserialize"><span class="kw3">unserialize</span></a><span class="br0">&#40;</span><a href="http://www.php.net/file_get_contents"><span class="kw3">file_get_contents</span></a><span class="br0">&#40;</span><span class="re0">$cacheFile</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div></li><li class="li1"><div class="de1"><span class="br0">&#125;</span></div></li></ol></pre></div></div>
<p>This is a very basic implementation of record set caching. This can be improved based on the application demand and other load factors. We&#8217;ve taken a more procedural approach in this code. In the next article I&#8217;d talk about handling the same in a more object oriented approach.</p>
<p>Do share your comments and suggestions.</p>
]]></content:encoded>
			<wfw:commentRss>http://markish.in/2010/12/implementing-output-caching-in-php-solve-perfomance-issues/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scheduling MySQL Backup..!</title>
		<link>http://markish.in/2008/09/scheduling-mysql-backup/</link>
		<comments>http://markish.in/2008/09/scheduling-mysql-backup/#comments</comments>
		<pubDate>Mon, 22 Sep 2008 19:12:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Automating MySQL Backup]]></category>
		<category><![CDATA[Markish]]></category>
		<category><![CDATA[MySQL Backup]]></category>
		<category><![CDATA[Scheduling MySQL backup]]></category>

		<guid isPermaLink="false">http://markishonline.com/2008/09/23/scheduling-mysql-backup/</guid>
		<description><![CDATA[    There have been instances when we need to schedule the backup process of MySQL databases regularly. So I thought of writing batch file that can be added in the Windows scheduler. I used the &#8216;mysqldump&#8217; utility that comes with the MySQL distributions. It dumps the database definition along with all the data, indexes, triggers and [...]]]></description>
			<content:encoded><![CDATA[<p>    There have been instances when we need to schedule the backup process of MySQL databases regularly. So I thought of writing batch file that can be added in the Windows scheduler. I used the &#8216;mysqldump&#8217; utility that comes with the MySQL distributions. It dumps the database definition along with all the data, indexes, triggers and SPs in the form of .sql file. I&#8217;ve also made the batch file to compress the output .sql file.</p>
<p><span id="more-78"></span>The complete script can be configured by setting some variables in it. I&#8217;ll explain the configuration parameters below.</p>
<div style="text-align: center">
<table style="border-collapse:collapse" border="0">
<colgroup span="1">
<col style="width: 83px;" span="1"></col>
<col style="width: 162px;" span="1"></col>
<col style="width: 393px;" span="1"></col>
</colgroup>
<tbody>
<tr>
<td style="padding-left: 7px; padding-right: 7px; border-top:  solid black 0.5pt; border-left:  solid black 0.5pt; border-bottom:  solid black 0.5pt; border-right:  solid black 0.5pt"><strong>SN</strong></td>
<td style="padding-left: 7px; padding-right: 7px; border-top:  solid black 0.5pt; border-left:  none; border-bottom:  solid black 0.5pt; border-right:  solid black 0.5pt"><strong>Parameter</strong></td>
<td style="padding-left: 7px; padding-right: 7px; border-top:  solid black 0.5pt; border-left:  none; border-bottom:  solid black 0.5pt; border-right:  solid black 0.5pt"><strong>Comments</strong></td>
</tr>
<tr>
<td style="padding-left: 7px; padding-right: 7px; border-top:  none; border-left:  solid black 0.5pt; border-bottom:  solid black 0.5pt; border-right:  solid black 0.5pt">1</td>
<td style="padding-left: 7px; padding-right: 7px; border-top:  none; border-left:  none; border-bottom:  solid black 0.5pt; border-right:  solid black 0.5pt">backupdir</td>
<td style="padding-left: 7px; padding-right: 7px; border-top:  none; border-left:  none; border-bottom:  solid black 0.5pt; border-right:  solid black 0.5pt">Tell where you want to store the final archive. If the folder doesn&#8217;t exist, Please create it.</td>
</tr>
<tr>
<td style="padding-left: 7px; padding-right: 7px; border-top:  none; border-left:  solid black 0.5pt; border-bottom:  solid black 0.5pt; border-right:  solid black 0.5pt">2</td>
<td style="padding-left: 7px; padding-right: 7px; border-top:  none; border-left:  none; border-bottom:  solid black 0.5pt; border-right:  solid black 0.5pt">workdir</td>
<td style="padding-left: 7px; padding-right: 7px; border-top:  none; border-left:  none; border-bottom:  solid black 0.5pt; border-right:  solid black 0.5pt">Tell where your temporary .sql file will get generated.</td>
</tr>
<tr>
<td style="padding-left: 7px; padding-right: 7px; border-top:  none; border-left:  solid black 0.5pt; border-bottom:  solid black 0.5pt; border-right:  solid black 0.5pt">3</td>
<td style="padding-left: 7px; padding-right: 7px; border-top:  none; border-left:  none; border-bottom:  solid black 0.5pt; border-right:  solid black 0.5pt">mysqldir</td>
<td style="padding-left: 7px; padding-right: 7px; border-top:  none; border-left:  none; border-bottom:  solid black 0.5pt; border-right:  solid black 0.5pt">Tell where the mysqldump exe is available. Generally it resides in the bin folder of the MySQL distribution.</td>
</tr>
<tr>
<td style="padding-left: 7px; padding-right: 7px; border-top:  none; border-left:  solid black 0.5pt; border-bottom:  solid black 0.5pt; border-right:  solid black 0.5pt">4</td>
<td style="padding-left: 7px; padding-right: 7px; border-top:  none; border-left:  none; border-bottom:  solid black 0.5pt; border-right:  solid black 0.5pt">logdir</td>
<td style="padding-left: 7px; padding-right: 7px; border-top:  none; border-left:  none; border-bottom:  solid black 0.5pt; border-right:  solid black 0.5pt">Tell where you want to put the logfile. I&#8217;ve included a small logging mechanism with the script as well</td>
</tr>
<tr>
<td style="padding-left: 7px; padding-right: 7px; border-top:  none; border-left:  solid black 0.5pt; border-bottom:  solid black 0.5pt; border-right:  solid black 0.5pt">5</td>
<td style="padding-left: 7px; padding-right: 7px; border-top:  none; border-left:  none; border-bottom:  solid black 0.5pt; border-right:  solid black 0.5pt">zip_dir</td>
<td style="padding-left: 7px; padding-right: 7px; border-top:  none; border-left:  none; border-bottom:  solid black 0.5pt; border-right:  solid black 0.5pt">Tell where your compressing utility is. It can be either Winzip or Winrar or gzip or any compression utility.</td>
</tr>
<tr>
<td style="padding-left: 7px; padding-right: 7px; border-top:  none; border-left:  solid black 0.5pt; border-bottom:  solid black 0.5pt; border-right:  solid black 0.5pt">6</td>
<td style="padding-left: 7px; padding-right: 7px; border-top:  none; border-left:  none; border-bottom:  solid black 0.5pt; border-right:  solid black 0.5pt">Servername, database, mysqluser, mysqlpassword</td>
<td style="padding-left: 7px; padding-right: 7px; border-top:  none; border-left:  none; border-bottom:  solid black 0.5pt; border-right:  solid black 0.5pt">DB Specific settings. Configure it here. <span style="color: #ff0000;"><strong>Please note this is available to anyone who has the access to this batch file.</strong></span></td>
</tr>
</tbody>
</table>
</div>
<p> </p>
<p>    Once you have the configuration done. Open the Windows Scheduler (from control panel) add this batch file and schedule it with the interval you want. You are done. You have your backup process running. The same script can be modified slightly to handle multiple databases if you need. This script can be downloaded from <a href="http://www.markishonline.com/downloads/mysql_backup.zip">here</a></p>
<p>Do share your comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://markish.in/2008/09/scheduling-mysql-backup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

