<?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>Grab A Meat  (MySql Learner)</title>
	<atom:link href="http://grabameat.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://grabameat.wordpress.com</link>
	<description>Learning Day by Day</description>
	<lastBuildDate>Sun, 29 Jan 2012 15:05:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='grabameat.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/0216177140c5283fa51047f3fcddc375?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Grab A Meat  (MySql Learner)</title>
		<link>http://grabameat.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://grabameat.wordpress.com/osd.xml" title="Grab A Meat  (MySql Learner)" />
	<atom:link rel='hub' href='http://grabameat.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Improving Replication Performance</title>
		<link>http://grabameat.wordpress.com/2012/01/29/improving-replication-performance/</link>
		<comments>http://grabameat.wordpress.com/2012/01/29/improving-replication-performance/#comments</comments>
		<pubDate>Sun, 29 Jan 2012 15:05:32 +0000</pubDate>
		<dc:creator>grabameat</dc:creator>
				<category><![CDATA[Database Administration]]></category>
		<category><![CDATA[Database Security]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[MySql]]></category>
		<category><![CDATA[best config]]></category>
		<category><![CDATA[config]]></category>
		<category><![CDATA[innodb config]]></category>
		<category><![CDATA[innodb configuration]]></category>
		<category><![CDATA[mysql config]]></category>
		<category><![CDATA[mysql database config]]></category>
		<category><![CDATA[mysql innodb config]]></category>
		<category><![CDATA[mysql slave performance]]></category>
		<category><![CDATA[replication]]></category>
		<category><![CDATA[replication performance]]></category>

		<guid isPermaLink="false">http://grabameat.wordpress.com/?p=245</guid>
		<description><![CDATA[Have  you ever seen your replica not catching upto speed even though you have everything setup properly in your config file, i faced this situation when i setup a new replication slave and replication lag keeps increasing or not catching up fast,  tried many ways to tweak the my.cnf  configuration file, increased memory, modified buffer_pool_size [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grabameat.wordpress.com&amp;blog=8513308&amp;post=245&amp;subd=grabameat&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Have  you ever seen your replica not catching upto speed even though you have everything setup properly in your config file, i faced this situation when i setup a new replication slave and replication lag keeps increasing or not catching up fast,  tried many ways to tweak the my.cnf  configuration file, increased memory, modified buffer_pool_size to the max limit of the memory, increased additional buffer, added more cpu&#8217;s does not helped me much to fix the replication lag. finally after reading to some other blogs i found  <strong>innodb</strong>_<strong>flush</strong>_<strong>log</strong>_<strong>at</strong>_<strong>trx</strong>_<strong>commit =1 </strong>is the reason for replication lag,</p>
<p>When the value is 1 (the default), the log buffer is written out to the log file at each transaction commit and the flush to disk operation is performed on the log file</p>
<p><strong>Solution:</strong> Set the value is 2, the log buffer is written out to the file at each commit, but the flush to disk operation is not performed on it. However, the flushing on the log file takes place once per second also when the value is 2.</p>
<p><strong>innodb_flush_log_at_trx_commit = 1</strong></p>
<p>Hope this helps..<br />
&nbsp;</p>
<p>&nbsp;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/grabameat.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/grabameat.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/grabameat.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/grabameat.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/grabameat.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/grabameat.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/grabameat.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/grabameat.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/grabameat.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/grabameat.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/grabameat.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/grabameat.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/grabameat.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/grabameat.wordpress.com/245/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grabameat.wordpress.com&amp;blog=8513308&amp;post=245&amp;subd=grabameat&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://grabameat.wordpress.com/2012/01/29/improving-replication-performance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3f6ce70b3776ab061ca481c7ec80919c?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">grabameat</media:title>
		</media:content>
	</item>
		<item>
		<title>Increasing Ulimit for Partitioning tables</title>
		<link>http://grabameat.wordpress.com/2012/01/27/increasing-ulimit-for-partitioning-tables/</link>
		<comments>http://grabameat.wordpress.com/2012/01/27/increasing-ulimit-for-partitioning-tables/#comments</comments>
		<pubDate>Fri, 27 Jan 2012 20:00:58 +0000</pubDate>
		<dc:creator>grabameat</dc:creator>
				<category><![CDATA[Database Administration]]></category>
		<category><![CDATA[MySql]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ulimit]]></category>
		<category><![CDATA[mysql partitioning]]></category>
		<category><![CDATA[partition tables]]></category>
		<category><![CDATA[mysql partition tables]]></category>

		<guid isPermaLink="false">http://grabameat.wordpress.com/?p=230</guid>
		<description><![CDATA[Data Ofen grow larger while we keep adding data to it and Retrieving data would slow down eventually and takes longer time to produce results, this is sometimes unacceptable for clients to wait that longer,  One great solution to Retrieve data faster without Archiving or purging any data is Table Partitioning,  Table will be broken [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grabameat.wordpress.com&amp;blog=8513308&amp;post=230&amp;subd=grabameat&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h3><span style="color:#993300;">Data Ofen grow larger while we keep adding data to it and Retrieving data would slow down eventually and takes longer time to produce results, this is sometimes unacceptable for clients to wait that longer,  One great solution to Retrieve data faster without Archiving or purging any data is Table Partitioning,  Table will be broken into small chunks according to date range / no.of records (like 1-100, 101-200, 201-300 and so on&#8230; )  and a lot of files will be created due to this partitioning,  </span></h3>
<h3><span style="color:#993300;">MySql User  on the HOST has a limit of only 4096 files to store by default. this has to be increased  to a certain number, otherwise  MySql database will be shutdown or corrupt due to insufficient files on the host.</span></h3>
<h3><span style="color:#993300;">To overcome this situation, you need to increase the file limit on the host.  Please add the below code in bash file and <strong>run it from your host as root</strong>, this will increase to the no.of files you need, but please make sure not to give the number above OS limit . the below example will allow 30,000 files for mysql user while creating any table partitions.</span></h3>
<p><span style="color:#0000ff;"><strong>**********************************************</strong></span></p>
<p><span style="color:#0000ff;"><strong>#! /bin/csh</strong></span></p>
<p><span style="color:#0000ff;"><strong>cat &gt;/etc/security/limits.d/mysql.conf &lt;&lt;EOF</strong></span><br />
<span style="color:#0000ff;"><strong>mysql soft nofile 30000</strong></span><br />
<span style="color:#0000ff;"><strong>mysql hard nofile 30000</strong></span><br />
<span style="color:#0000ff;"><strong>EOF</strong></span></p>
<p><span style="color:#0000ff;"><strong>**********************************************</strong></span></p>
<p>To test the above scritp. login as user mysql and run &#8220;ulimit -n&#8221; command.</p>
<p><strong>before running the script</strong><br />
&gt; ulimit -n<br />
4096</p>
<p><strong>After running the above script</strong><br />
&gt; ulimit -n<br />
30000</p>
<p>&nbsp;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/grabameat.wordpress.com/230/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/grabameat.wordpress.com/230/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/grabameat.wordpress.com/230/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/grabameat.wordpress.com/230/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/grabameat.wordpress.com/230/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/grabameat.wordpress.com/230/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/grabameat.wordpress.com/230/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/grabameat.wordpress.com/230/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/grabameat.wordpress.com/230/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/grabameat.wordpress.com/230/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/grabameat.wordpress.com/230/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/grabameat.wordpress.com/230/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/grabameat.wordpress.com/230/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/grabameat.wordpress.com/230/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grabameat.wordpress.com&amp;blog=8513308&amp;post=230&amp;subd=grabameat&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://grabameat.wordpress.com/2012/01/27/increasing-ulimit-for-partitioning-tables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3f6ce70b3776ab061ca481c7ec80919c?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">grabameat</media:title>
		</media:content>
	</item>
		<item>
		<title>New Config File Creator from Percona</title>
		<link>http://grabameat.wordpress.com/2012/01/23/new-config-file-creator-from-percona/</link>
		<comments>http://grabameat.wordpress.com/2012/01/23/new-config-file-creator-from-percona/#comments</comments>
		<pubDate>Mon, 23 Jan 2012 20:05:05 +0000</pubDate>
		<dc:creator>grabameat</dc:creator>
				<category><![CDATA[Database Administration]]></category>
		<category><![CDATA[MySql]]></category>
		<category><![CDATA[percona]]></category>

		<guid isPermaLink="false">http://grabameat.wordpress.com/2012/01/23/new-config-file-creator-from-percona/</guid>
		<description><![CDATA[Percona Tools Website   is a beautiful tool to build a config file according to your Server Requirements, which is  a real benefit for any Companies who are using MySql having any Server performance issue, This tool may not exactly suit all your required settings but it surely helps you to build a better config [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grabameat.wordpress.com&amp;blog=8513308&amp;post=227&amp;subd=grabameat&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h4><span style="color:#0000ff;"><a title="Percona Tools " href="http://tools.percona.com" target="_blank"><span style="color:#0000ff;">Percona Tools Website</span></a></span>   is a beautiful tool to build a config file according to your Server Requirements, which is  a real benefit for any Companies who are using MySql having any Server performance issue, This tool may not exactly suit all your required settings but it surely helps you to build a better config file, you can modify it after creating this file.</h4>
<p>it is worth a try&#8230;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/grabameat.wordpress.com/227/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/grabameat.wordpress.com/227/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/grabameat.wordpress.com/227/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/grabameat.wordpress.com/227/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/grabameat.wordpress.com/227/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/grabameat.wordpress.com/227/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/grabameat.wordpress.com/227/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/grabameat.wordpress.com/227/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/grabameat.wordpress.com/227/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/grabameat.wordpress.com/227/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/grabameat.wordpress.com/227/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/grabameat.wordpress.com/227/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/grabameat.wordpress.com/227/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/grabameat.wordpress.com/227/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grabameat.wordpress.com&amp;blog=8513308&amp;post=227&amp;subd=grabameat&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://grabameat.wordpress.com/2012/01/23/new-config-file-creator-from-percona/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3f6ce70b3776ab061ca481c7ec80919c?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">grabameat</media:title>
		</media:content>
	</item>
		<item>
		<title>Extracting 1 week of Data from a Big log File</title>
		<link>http://grabameat.wordpress.com/2010/08/23/extracting-1-week-of-data-from-a-big-log-file/</link>
		<comments>http://grabameat.wordpress.com/2010/08/23/extracting-1-week-of-data-from-a-big-log-file/#comments</comments>
		<pubDate>Mon, 23 Aug 2010 12:59:52 +0000</pubDate>
		<dc:creator>grabameat</dc:creator>
				<category><![CDATA[Database Administration]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[MySql]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[hug log file]]></category>
		<category><![CDATA[log file]]></category>
		<category><![CDATA[sed]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://grabameat.wordpress.com/?p=194</guid>
		<description><![CDATA[It is very difficult to read one week of data from a Big Log file (i.e 2gb size log file).  where it takes 100% cpu and blocks all the processess, and take s more time to get a small piece of data using less command in unix.   to resolve this, search for the first [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grabameat.wordpress.com&amp;blog=8513308&amp;post=194&amp;subd=grabameat&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="color:#0000ff;"><strong>It is very difficult to read one week of data from a Big Log file (i.e 2gb size log file).  where it takes 100% cpu and blocks all the processess, and take s more time to get a small piece of data using less command in unix.   to resolve this, search for the first line number of the 1st day of the Week and last line no of the last day of the Week and use SED command to extract from starting line position to end line position, copy that data to a new file. </strong></span></p>
<p><span style="color:#800000;">First Try to Find the Line No&#8217;s of the Starting Date of 1 week (lets say 9 Apr 2010 &#8211; 16 Apr 2010)<br />
</span><strong><span style="color:#800000;"><br />
grep -n &#8216;Time: 100409&#8242; /var/log/mysqld/myserver_slow_queries.log | more</span></strong><span style="color:#800000;"></p>
<p>Copy or write down the Line no. let&#8217;s say  2399098<br />
</span><strong><span style="color:#800000;"><br />
grep -n &#8216;Time: 100416&#8242; /var/log/mysqld/myserver_slow_queries.log | more</span></strong><span style="color:#800000;"></p>
<p>Copy or write down the Last Line no. 2483712</p>
<p>now run the SED Unix Command to grab the data from start line to end line into a new log file.<br />
</span><strong><span style="color:#800000;"><br />
sed -n 2399098,2483712p myserver_slow_queries.log &gt; myserver_slow_queries.log.week</span></strong><span style="color:#800000;"> </span></p>
<p><span style="color:#800000;"><span style="color:#000000;">Done. One Week of Data from a Big Log file will be copied to a new file.</span></span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/grabameat.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/grabameat.wordpress.com/194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/grabameat.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/grabameat.wordpress.com/194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/grabameat.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/grabameat.wordpress.com/194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/grabameat.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/grabameat.wordpress.com/194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/grabameat.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/grabameat.wordpress.com/194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/grabameat.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/grabameat.wordpress.com/194/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/grabameat.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/grabameat.wordpress.com/194/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grabameat.wordpress.com&amp;blog=8513308&amp;post=194&amp;subd=grabameat&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://grabameat.wordpress.com/2010/08/23/extracting-1-week-of-data-from-a-big-log-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3f6ce70b3776ab061ca481c7ec80919c?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">grabameat</media:title>
		</media:content>
	</item>
		<item>
		<title>MySql Flush Hosts</title>
		<link>http://grabameat.wordpress.com/2010/08/16/mysql-flush-hosts/</link>
		<comments>http://grabameat.wordpress.com/2010/08/16/mysql-flush-hosts/#comments</comments>
		<pubDate>Mon, 16 Aug 2010 04:18:21 +0000</pubDate>
		<dc:creator>grabameat</dc:creator>
				<category><![CDATA[Database Administration]]></category>
		<category><![CDATA[MySql]]></category>
		<category><![CDATA[flush hosts]]></category>
		<category><![CDATA[mysql flush hosts]]></category>

		<guid isPermaLink="false">http://grabameat.wordpress.com/?p=188</guid>
		<description><![CDATA[I got a below connection error recently on our server,  but resolved after certain attempts. FLUSH Hosts is the command where it Flush out the connection errors and allow MySql to connect again. [Tue Jun 01 16:07:10 2010] [error] [client 100.100.11.12]  DBI connect('host:database:port;mysql_connect_timeout=10','web',...) failed: Host 'mysite.net' is blocked because of many connection errors; unblock with [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grabameat.wordpress.com&amp;blog=8513308&amp;post=188&amp;subd=grabameat&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I got a below connection error recently on our server,  but resolved after certain attempts. FLUSH Hosts is the command where it Flush out the connection errors and allow MySql to connect again.</p>
<pre>
<strong><em>[Tue Jun 01 16:07:10 2010] [error] [client 100.100.11.12] </em></strong>

<strong><em>DBI connect('host:database:port;mysql_connect_timeout=10','web',...)</em></strong>

<strong><em>failed: Host 'mysite.net' is blocked because of many connection errors;</em></strong>

<strong><em>unblock with 'mysqladmin flush-hosts' at [Tue Jun 01 16:07:10 2010]</em></strong>

<strong><em>[error] [client 100.100.21.211]</em></strong>

 
<strong>
Solution:
</strong><strong>
<em><span style="text-decoration:underline;">FLUSH HOSTS</span></em> will Free all the connection errors from buffer.
</strong><strong>
</strong></pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/grabameat.wordpress.com/188/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/grabameat.wordpress.com/188/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/grabameat.wordpress.com/188/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/grabameat.wordpress.com/188/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/grabameat.wordpress.com/188/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/grabameat.wordpress.com/188/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/grabameat.wordpress.com/188/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/grabameat.wordpress.com/188/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/grabameat.wordpress.com/188/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/grabameat.wordpress.com/188/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/grabameat.wordpress.com/188/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/grabameat.wordpress.com/188/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/grabameat.wordpress.com/188/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/grabameat.wordpress.com/188/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grabameat.wordpress.com&amp;blog=8513308&amp;post=188&amp;subd=grabameat&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://grabameat.wordpress.com/2010/08/16/mysql-flush-hosts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3f6ce70b3776ab061ca481c7ec80919c?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">grabameat</media:title>
		</media:content>
	</item>
		<item>
		<title>Linux Screen Remote Login Issue</title>
		<link>http://grabameat.wordpress.com/2010/08/16/linux-screen-remote-login-issue/</link>
		<comments>http://grabameat.wordpress.com/2010/08/16/linux-screen-remote-login-issue/#comments</comments>
		<pubDate>Mon, 16 Aug 2010 03:05:43 +0000</pubDate>
		<dc:creator>grabameat</dc:creator>
				<category><![CDATA[Database Administration]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[MySql]]></category>
		<category><![CDATA[screen]]></category>
		<category><![CDATA[screen utility]]></category>
		<category><![CDATA[screen utility error]]></category>
		<category><![CDATA[shell screen]]></category>
		<category><![CDATA[unix screen]]></category>

		<guid isPermaLink="false">http://grabameat.wordpress.com/?p=182</guid>
		<description><![CDATA[If you ever get the below error while you try to activate screen (Unix Screen Utility) as a different user rather than your login .  (for ex: i logged in as john and sudo admin and type screen at prompt). Cannot open your terminal &#8216;/dev/pts/7&#8242; &#8211; please check 1) Exit out of the user First. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grabameat.wordpress.com&amp;blog=8513308&amp;post=182&amp;subd=grabameat&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you ever get the below error while you try to activate screen (Unix Screen Utility) as a different user rather than your login .  (for ex: i logged in as john and sudo admin and type screen at prompt).</p>
<p><em><strong>Cannot open your terminal &#8216;/dev/pts/7&#8242; &#8211; please check</strong></em></p>
<p><strong><em>1) Exit out of the user First. </em></strong></p>
<p><strong><em>2) cd /dev/pts/7</em></strong></p>
<p><em><strong>3) chmod +0666 /dev/pts/7 </strong></em></p>
<p><em><strong> 4) then sudo su user </strong></em></p>
<p><em><strong> 5) type Screen. then it&#8217;ll work.</strong></em></p>
<p><em>Please let me know if this doesn&#8217;t work..</em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/grabameat.wordpress.com/182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/grabameat.wordpress.com/182/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/grabameat.wordpress.com/182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/grabameat.wordpress.com/182/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/grabameat.wordpress.com/182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/grabameat.wordpress.com/182/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/grabameat.wordpress.com/182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/grabameat.wordpress.com/182/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/grabameat.wordpress.com/182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/grabameat.wordpress.com/182/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/grabameat.wordpress.com/182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/grabameat.wordpress.com/182/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/grabameat.wordpress.com/182/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/grabameat.wordpress.com/182/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grabameat.wordpress.com&amp;blog=8513308&amp;post=182&amp;subd=grabameat&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://grabameat.wordpress.com/2010/08/16/linux-screen-remote-login-issue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3f6ce70b3776ab061ca481c7ec80919c?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">grabameat</media:title>
		</media:content>
	</item>
		<item>
		<title>MASTER Master Replication Tutorial</title>
		<link>http://grabameat.wordpress.com/2009/11/18/master-master-replication-tutorial/</link>
		<comments>http://grabameat.wordpress.com/2009/11/18/master-master-replication-tutorial/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 06:34:42 +0000</pubDate>
		<dc:creator>grabameat</dc:creator>
				<category><![CDATA[Database Administration]]></category>
		<category><![CDATA[MySql]]></category>
		<category><![CDATA[MYSQL DBA]]></category>
		<category><![CDATA[mysql master master replication]]></category>
		<category><![CDATA[mysql master replication]]></category>
		<category><![CDATA[Mysql Replication]]></category>

		<guid isPermaLink="false">http://grabameat.wordpress.com/?p=176</guid>
		<description><![CDATA[from http://www.howtoforge.com/mysql_master_master_replication<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grabameat.wordpress.com&amp;blog=8513308&amp;post=176&amp;subd=grabameat&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Slave_IO_State: Waiting for master to send event<br />
Master_Host: 192.168.16.4<br />
Master_User: replica<br />
Master_Port: 3306<br />
Connect_Retry: 60<br />
Master_Log_File: MASTERMYSQL01-bin.000009<br />
Read_Master_Log_Pos: 4</p>
<address> Relay_Log_File: MASTERMYSQL02-relay-bin.000015</address>
<p>Relay_Log_Pos: 3630<br />
Relay_Master_Log_File: MASTERMYSQL01-bin.000009<br />
Slave_IO_Running: Yes<br />
Slave_SQL_Running: Yes<br />
Replicate_Do_DB:<br />
Replicate_Ignore_DB:<br />
Replicate_Do_Table:<br />
Replicate_Ignore_Table:<br />
Replicate_Wild_Do_Table:<br />
Replicate_Wild_Ignore_Table:<br />
Last_Errno: 0<br />
Last_Error:<br />
Skip_Counter: 0<br />
Exec_Master_Log_Pos: 4<br />
Relay_Log_Space: 3630<br />
Until_Condition: None<br />
Until_Log_File:<br />
Until_Log_Pos: 0<br />
Master_SSL_Allowed: No<br />
Master_SSL_CA_File:<br />
Master_SSL_CA_Path:<br />
Master_SSL_Cert:<br />
Master_SSL_Cipher:<br />
Master_SSL_Key:<br />
Seconds_Behind_Master: 1519187</p>
<p>1 row in set (0.00 sec)</p>
<p>Above highlighted rows must be indicate related log files and  Slave_IO_Running and   Slave_SQL_Running: must be to YES.</p>
<h3>Step 6:</h3>
<p>On master 1:</p>
<p>mysql&gt; show master status;<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+<br />
| File                   | Position | Binlog_Do_DB | Binlog_Ignore_DB |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+<br />
|MysqlMYSQL01-bin.000008 |      410 | adam         |                  |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8211;+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;+<br />
1 row in set (0.00 sec)</p>
<p>The above scenario is for master-slave, now we will create a slave master scenario for the same systems and it will work as master master.</p>
<h3>Step 7:</h3>
<p>On Master2/Slave 1, edit my.cnf and master entries into it:</p>
<p>[mysqld]<br />
datadir=/var/lib/mysql<br />
socket=/var/lib/mysql/mysql.sock<br />
# Default to using old password format for compatibility with mysql 3.x<br />
# clients (those using the mysqlclient10 compatibility package).<br />
old_passwords=1<br />
server-id=2</p>
<p>master-host = 192.168.16.4<br />
master-user = replication<br />
master-password = slave<br />
master-port = 3306</p>
<p>log-bin                     #information for becoming master added<br />
binlog-do-db=adam</p>
<p>[mysql.server]<br />
user=mysql<br />
basedir=/var/lib</p>
<p>[mysqld_safe]<br />
err-log=/var/log/mysqld.log<br />
pid-file=/var/run/mysqld/mysqld.pid</p>
<h3>Step 8:</h3>
<p><strong></strong>Create a replication slave account on master2 for master1:</p>
<p>mysql&gt; grant replication slave on *.* to &#8216;<a href="mailto:replication%27@192.168.16.4" target="_blank">replication&#8217;@192.168.16.4</a> identified by &#8216;slave2&#8242;;</p>
<h3>Step 9:</h3>
<p><strong></strong>Edit my.cnf on master1 for information of its master.</p>
<p>[mysqld]<br />
datadir=/var/lib/mysql<br />
socket=/var/lib/mysql/mysql.sock</p>
<p># Default to using old password format for compatibility with mysql 3.x<br />
# clients (those using the mysqlclient10 compatibility package).<br />
old_passwords=1</p>
<p>log-bin<br />
binlog-do-db=adam<br />
binlog-ignore-db=mysql<br />
binlog-ignore-db=test</p>
<p>server-id=1<br />
#information for becoming slave.<br />
master-host = 192.168.16.5<br />
master-user = replication<br />
master-password = slave2<br />
master-port = 3306</p>
<p>[mysql.server]user=mysqlbasedir=/var/lib</p>
<p>[mysqld_safe]<br />
err-log=/var/log/mysqld.log<br />
pid-file=/var/run/mysqld/mysqld.pid</p>
<h3>Step 10:</h3>
<p>Restart both mysql master1 and master2.</p>
<p>On mysql master1:</p>
<p>mysql&gt; start slave;</p>
<p>On mysql master2:</p>
<p>mysql &gt; show master status;</p>
<p>On mysql master 1:</p>
<p>mysql&gt; show slave status\G;<br />
*************************** 1. row ***************************<br />
Slave_IO_State: Waiting for master to send event<br />
Master_Host: 192.168.16.5<br />
Master_User: replica<br />
Master_Port: 3306<br />
Connect_Retry: 60<br />
Master_Log_File: Mysql1MYSQL02-bin.000008<br />
Read_Master_Log_Pos: 410<br />
Relay_Log_File: Mysql1MYSQL01-relay-bin.000008<br />
Relay_Log_Pos: 445<br />
Relay_Master_Log_File: Mysql1MYSQL02-bin.000008<br />
Slave_IO_Running: Yes<br />
Slave_SQL_Running: Yes<br />
Replicate_Do_DB:<br />
Replicate_Ignore_DB:<br />
Replicate_Do_Table:<br />
Replicate_Ignore_Table:<br />
Replicate_Wild_Do_Table:<br />
Replicate_Wild_Ignore_Table:<br />
Last_Errno: 0<br />
Last_Error:<br />
Skip_Counter: 0<br />
Exec_Master_Log_Pos: 410<br />
Relay_Log_Space: 445<br />
Until_Condition: None<br />
Until_Log_File:<br />
Until_Log_Pos: 0<br />
Master_SSL_Allowed: No<br />
Master_SSL_CA_File:<br />
Master_SSL_CA_Path:<br />
Master_SSL_Cert:<br />
Master_SSL_Cipher:<br />
Master_SSL_Key:<br />
Seconds_Behind_Master: 103799<br />
1 row in set (0.00 sec)</p>
<p>ERROR:<br />
No query specified</p>
<p>Check for the hightlighted rows, make sure its running. Now you can create tables in the database and you will see changes in slave. <strong>Enjoy!!</strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/grabameat.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/grabameat.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/grabameat.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/grabameat.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/grabameat.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/grabameat.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/grabameat.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/grabameat.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/grabameat.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/grabameat.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/grabameat.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/grabameat.wordpress.com/176/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/grabameat.wordpress.com/176/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/grabameat.wordpress.com/176/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grabameat.wordpress.com&amp;blog=8513308&amp;post=176&amp;subd=grabameat&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://grabameat.wordpress.com/2009/11/18/master-master-replication-tutorial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3f6ce70b3776ab061ca481c7ec80919c?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">grabameat</media:title>
		</media:content>
	</item>
		<item>
		<title>Best INNODB Configuration (my.cnf) file</title>
		<link>http://grabameat.wordpress.com/2009/11/11/best-innodb-configuration-my-cnf-file/</link>
		<comments>http://grabameat.wordpress.com/2009/11/11/best-innodb-configuration-my-cnf-file/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 19:22:26 +0000</pubDate>
		<dc:creator>grabameat</dc:creator>
				<category><![CDATA[Database Administration]]></category>
		<category><![CDATA[MySql]]></category>
		<category><![CDATA[innodb config]]></category>
		<category><![CDATA[innodb configuration]]></category>
		<category><![CDATA[my.cnf]]></category>
		<category><![CDATA[my.cnf configuration]]></category>
		<category><![CDATA[MySql Configuration]]></category>

		<guid isPermaLink="false">http://grabameat.wordpress.com/?p=162</guid>
		<description><![CDATA[[client] port = 3306 socket = /var/run/mysqld/mysqld.sock [mysqld_safe] socket = /var/run/mysqld/mysqld.sock nice = 0 [mysqld] user = mysql pid-file = /var/run/mysqld/mysqld.pid socket = /var/run/mysqld/mysqld.sock port = 3306 basedir = /usr datadir = /var/lib/mysql tmpdir = /tmp language = /usr/share/mysql/english skip-external-locking bind-address = 192.168.2.200 key_buffer = 16M max_allowed_packet = 16000M thread_stack = 128K thread_cache_size = 8 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grabameat.wordpress.com&amp;blog=8513308&amp;post=162&amp;subd=grabameat&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<pre>
<h2>[client]</h2>

<span style="color:#ff0000;">
<h2>port		= 3306</h2>
<h2>socket		= /var/run/mysqld/mysqld.sock</h2>

</span>
<h2>[mysqld_safe]</h2>

<span style="color:#0000ff;">
<h2>socket		= /var/run/mysqld/mysqld.sock</h2>
<h2>nice		= 0</h2>

</span>
<h2>[mysqld]</h2>

<span style="color:#0000ff;">
<h2>user		= mysql</h2>
<h2>pid-file	= /var/run/mysqld/mysqld.pid</h2>
<h2>socket		= /var/run/mysqld/mysqld.sock</h2>
<h2>port		= 3306</h2>
<h2>basedir		= /usr</h2>
<h2>datadir		= /var/lib/mysql</h2>
<h2>tmpdir		= /tmp</h2>
<h2>language	= /usr/share/mysql/english</h2>
<h2>skip-external-locking</h2>
<h2>bind-address		= 192.168.2.200</h2>
<h2>key_buffer		= 16M</h2>
<h2>max_allowed_packet	= 16000M</h2>
<h2>thread_stack		= 128K</h2>
<h2>thread_cache_size	= 8</h2>
<h2>#max_connections        = 100</h2>
<h2>#table_cache            = 64</h2>
<h2>#thread_concurrency     = 10</h2>
<h2>query_cache_limit       = 1M</h2>
<h2>query_cache_size        = 1024M</h2>
<h2>innodb_buffer_pool_size=2048M</h2>
<h2>innodb_additional_mem_pool_size=400M</h2>
<h2>innodb_log_file_size=25M</h2>
<h2>innodb_log_buffer_size=80M</h2>
<h2>sort_buffer=512M</h2>
<h2>thread_concurrency=32</h2>
<h2>record_buffer=128M</h2>
<h2>query_cache_type=2</h2>
<h2>tmp_table_size=1G</h2>
<h2>#log		= /var/log/mysql/mysql.log</h2>
<h2>#log_slow_queries	= /var/log/mysql/mysql-slow.log</h2>
<h2>#long_query_time = 2</h2>
<h2>#log-queries-not-using-indexes</h2>
<h2>#server-id		= 1</h2>
<h2>#log_bin			= /var/log/mysql/mysql-bin.log</h2>
<h2>expire_logs_days	= 10</h2>
<h2>max_binlog_size         = 100M</h2>
<h2>#binlog_do_db		= include_database_name</h2>
<h2>#binlog_ignore_db	= include_database_name</h2>
<h2>#skip-innodb</h2>
<h2># chroot = /var/lib/mysql/</h2>
<h2>[mysqldump]</h2>
<h2>quick</h2>
<h2>quote-names</h2>
<h2>max_allowed_packet	= 16M</h2>

</span>
<h2>[mysql]</h2>

<span style="color:#0000ff;">
<h2>#no-auto-rehash	# faster start of mysql but no tab completition</h2>

</span>
<h2>[isamchk]</h2>

<span style="color:#0000ff;">
<h2>key_buffer		= 16M</h2>

</span><span style="color:#0000ff;">
<h2>* Turn off HyperThreading -- it tends to slow things down.</h2>

<span style="color:#ff0000;">
<h2>* key_buffer = 16M -- very small if you use any MyISAM. In which case, set it to 3000M. (It must not be bigger than 4G.) Since you are not using any MyISAM, leave it at 16M.</h2>
<h2>* query_cache_size = 1024M -- The bigger it is, the slower it runs. Suggest 200M.</h2>
<h2>* innodb_buffer_pool_size=2048M -- You have 16GB of RAM. Is it 'all' available to MySQL? If so, and you are using InnoDB exclusively, suggest 13G.</h2>
<h2>* If mixture of MyISAM and Innodb, adjust proportionally.</h2>
<h2>* InnoDB database with 1,7 GiB of data? Wasted your money on so much RAM.</h2>
<h2>* #log_slow_queries	= /var/log/mysql/mysql-slow.log</h2>
<h2>#long_query_time = 2</h2>
<h2>Do you have any control over the schema or queries? Perhaps not if you are using a canned product. If you did have control, I would recommend turning on the slowlog and using it to help tune things.</h2>
<h2>* #max_connections = 100 -- I don't know what the default is; keep an eye on max_used_connections. If you run out of connections set max_connections appropriately.</h2>
<h2>* #table_cache = 64 -- You can probably set this to something, then watch open_tables to see whether it needs to be bigger.</h2>
<h2>Executive summary: Your current settings are close to the best available.</h2>

</span></span></pre>
<h2>This is one of the Best Configuration file from MYSQL</h2>
<h2>ADMINISTRATION BIBLE BOOK.</h2>
<pre><span style="color:#0000ff;">
<h2>The configuration file supports options for multiple programs. Each program has its own directive,</h2>
<h2>which is a keyword in square brackets, such as [mysqld] or [client]. Here is a sample</h2>
<h2>configuration file from a production system:</h2>
<h2># The following options will be passed to all MySQL clients</h2>
<h2>[client]</h2>
<h2>port = 3306</h2>
<h2>socket = /var/lib/mysql/mysql.sock</h2>
<h2>[mysqld]</h2>
<h2>#this will prevent mysql from starting</h2>
<h2>port = 3306</h2>
<h2>socket = /var/lib/mysql/mysql.sock</h2>
<h2>datadir =/var/lib/mysql</h2>
<h2>log_slow_queries = /var/log/mysql/mysqld_slow-queries.log</h2>
<h2>long_query_time = 4</h2>
<h2>max_connections=200</h2>
<h2>max_connect_errors = 400</h2>
<h2>wait_timeout=7200</h2>
<h2>connect_timeout=10</h2>
<h2>key_buffer = 512M</h2>
<h2>tmp_table_size = 32M</h2>
<h2>max_heap_table_size = 32M</h2>
<h2>max_allowed_packet = 32M</h2>
<h2>table_cache = 1800</h2>
<h2>join_buffer_size = 8M</h2>
<h2>sort_buffer_size = 16M</h2>
<h2>read_buffer_size = 8M</h2>
<h2>read_rnd_buffer_size = 524288</h2>
<h2>myisam_sort_buffer_size = 256M</h2>
<h2>thread_cache_size = 384</h2>
<h2>bulk_insert_buffer_size = 8M</h2>
<h2>query_cache_limit = 4M</h2>
<h2>query_cache_size = 128M</h2>
<h2>query_cache_type = 1</h2>
<h2>362</h2>
<h2>MySQL Server Tuning 10</h2>
<h2>query_prealloc_size = 65536</h2>
<h2>query_alloc_block_size = 131072</h2>
<h2># Try number of CPU’s*2 for thread_concurrency</h2>
<h2>thread_concurrency = 4</h2>
<h2>#innodb configuration</h2>
<h2>innodb_data_home_dir = /mysql/data</h2>
<h2>innodb_data_file_path=ibdata1:200M:autoextend</h2>
<h2>innodb_log_group_home_dir = /mysql/data/data</h2>
<h2>innodb_log_arch_dir = /mysql/data/data</h2>
<h2>innodb_buffer_pool_size = 24576M</h2>
<h2>innodb_additional_mem_pool_size = 32M</h2>
<h2>innodb_log_file_size = 1024M</h2>
<h2>innodb_log_files_in_group = 2</h2>
<h2>innodb_log_buffer_size = 16M</h2>
<h2>innodb_flush_log_at_trx_commit = 1</h2>
<h2>innodb_lock_wait_timeout = 120</h2>
<h2>sync-binlog = 1</h2>
<h2>innodb_support_xa = 0</h2>
<h2>innodb_thread_concurrency = 128</h2>
<h2>innodb_file_per_table</h2>
<h2># binary logging is required for replication</h2>
<h2>log-bin=mysql-bin</h2>
<h2>max_binlog_size = 1024M</h2>
<h2>server-id = 4</h2>
<h2>slave-skip-errors = 1062</h2>
<h2>expire-logs-days = 7</h2>
<h2>[mysqldump]</h2>
<h2>quick</h2>
<h2>max_allowed_packet = 16M</h2>
<h2>[mysql.server]</h2>
<h2>user=mysql</h2>
<h2>group=mysql</h2>
<h2>basedir=/var/lib</h2>
<h2>[mysqld_safe]</h2>
<h2>nice = -5</h2>
<h2>open_files_limit = 8192</h2>
<h2>log-error=/var/log/mysql/mysqld.log</h2>
<h2>pid-file=/var/run/mysqld/mysqld.pid</h2>
<h2>The configuration file supports options for multiple programs. Each program has its own directive,which is a keyword in square brackets, such as [mysqld] or [client]. Here is a sampleconfiguration file from a production system:# The following options will be passed to all MySQL clients[client]port = 3306socket = /var/lib/mysql/mysql.sock[mysqld]#this will prevent mysql from startingport = 3306socket = /var/lib/mysql/mysql.sockdatadir =/var/lib/mysqllog_slow_queries = /var/log/mysql/mysqld_slow-queries.loglong_query_time = 4max_connections=200max_connect_errors = 400wait_timeout=7200connect_timeout=10key_buffer = 512Mtmp_table_size = 32Mmax_heap_table_size = 32Mmax_allowed_packet = 32Mtable_cache = 1800join_buffer_size = 8Msort_buffer_size = 16Mread_buffer_size = 8Mread_rnd_buffer_size = 524288myisam_sort_buffer_size = 256Mthread_cache_size = 384bulk_insert_buffer_size = 8Mquery_cache_limit = 4Mquery_cache_size = 128Mquery_cache_type = 1362MySQL Server Tuning 10query_prealloc_size = 65536query_alloc_block_size = 131072# Try number of CPU’s*2 for thread_concurrencythread_concurrency = 4#innodb configurationinnodb_data_home_dir = /mysql/datainnodb_data_file_path=ibdata1:200M:autoextendinnodb_log_group_home_dir = /mysql/data/datainnodb_log_arch_dir = /mysql/data/datainnodb_buffer_pool_size = 24576Minnodb_additional_mem_pool_size = 32Minnodb_log_file_size = 1024Minnodb_log_files_in_group = 2innodb_log_buffer_size = 16Minnodb_flush_log_at_trx_commit = 1innodb_lock_wait_timeout = 120sync-binlog = 1innodb_support_xa = 0innodb_thread_concurrency = 128innodb_file_per_table# binary logging is required for replicationlog-bin=mysql-binmax_binlog_size = 1024Mserver-id = 4slave-skip-errors = 1062expire-logs-days = 7[mysqldump]quickmax_allowed_packet = 16M[mysql.server]user=mysqlgroup=mysqlbasedir=/var/lib[mysqld_safe]nice = -5open_files_limit = 8192log-error=/var/log/mysql/mysqld.logpid-file=/var/run/mysqld/mysqld.pid</h2>

</span><span style="color:#0000ff;"><span style="font-family:Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;font-size:small;"><span style="line-height:19px;white-space:normal;">
</span></span></span></pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/grabameat.wordpress.com/162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/grabameat.wordpress.com/162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/grabameat.wordpress.com/162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/grabameat.wordpress.com/162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/grabameat.wordpress.com/162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/grabameat.wordpress.com/162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/grabameat.wordpress.com/162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/grabameat.wordpress.com/162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/grabameat.wordpress.com/162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/grabameat.wordpress.com/162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/grabameat.wordpress.com/162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/grabameat.wordpress.com/162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/grabameat.wordpress.com/162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/grabameat.wordpress.com/162/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grabameat.wordpress.com&amp;blog=8513308&amp;post=162&amp;subd=grabameat&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://grabameat.wordpress.com/2009/11/11/best-innodb-configuration-my-cnf-file/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3f6ce70b3776ab061ca481c7ec80919c?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">grabameat</media:title>
		</media:content>
	</item>
		<item>
		<title>What to do when MySQL says skip-innodb is defined</title>
		<link>http://grabameat.wordpress.com/2009/11/10/what-to-do-when-mysql-says-skip-innodb-is-defined/</link>
		<comments>http://grabameat.wordpress.com/2009/11/10/what-to-do-when-mysql-says-skip-innodb-is-defined/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 23:03:39 +0000</pubDate>
		<dc:creator>grabameat</dc:creator>
				<category><![CDATA[Database Administration]]></category>
		<category><![CDATA[MySql]]></category>
		<category><![CDATA[MYSQL DBA]]></category>
		<category><![CDATA[mysql innodb]]></category>

		<guid isPermaLink="false">http://grabameat.wordpress.com/?p=159</guid>
		<description><![CDATA[Are you seeing a MySQL error that says InnoDB support isn’t enabled, even though it is? This article explains why it happens and how to fix it. The symptom Suppose you call SHOW INNODB STATUS or another InnoDB-specific command and MySQL reports the following error: “ERROR 1235 (42000): Cannot call SHOW INNODB STATUS because skip-innodb is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grabameat.wordpress.com&amp;blog=8513308&amp;post=159&amp;subd=grabameat&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Are you seeing a MySQL error that says InnoDB support isn’t enabled, even though it is? This article explains why it happens and how to fix it.</p>
<h3>The symptom</h3>
<p>Suppose you call <code>SHOW INNODB STATUS</code> or another InnoDB-specific command and MySQL reports the following error:</p>
<p>“ERROR 1235 (42000): Cannot call SHOW INNODB STATUS because skip-innodb is defined”</p>
<p>Yet you search the MySQL configuration files and find that’s not true. And you know you have InnoDB tables, too. What’s going on?</p>
<p>As it turns out, the error message is a bit misleading. Many problems will cause this error message.</p>
<h3>Dig deeper</h3>
<p>If InnoDB says it’s disabled, it probably is. Look at a couple other things. Does <code>SHOW ENGINES</code> report InnoDB is disabled? How about <code>SHOW VARIABLES LIKE 'have_innodb'</code>? Try <code>SHOW TABLE STATUS</code> on an InnoDB table — are most columns <code>NULL</code>?</p>
<p>If so, you most likely have an InnoDB configuration error. Not that you’ve disabled it with <code>skip-innodb</code>, but there’s something wrong. If so, MySQL will still start, but the InnoDB storage engine, and tables that use it, will be disabled.</p>
<h3>One possible solution</h3>
<p>When this happened to me, it was a config file upgrade that I didn’t check carefully. The old directive for the InnoDB data file was as follows:</p>
<pre>innodb_data_file_path           = ibdata1:10M:autoextend</pre>
<p>When I upgraded the file, I changed it to</p>
<pre>innodb_data_file_path = ibdata1:10M:autoextend:max:128M</pre>
<p>That wouldn’t have been a problem, except the file was already larger than 128MB. This is a slightly hard error to catch sometimes, because it may not show up in your MySQL error log (it doesn’t on my Ubuntu laptop when I deliberately force the error to happen).</p>
<h3>A note of general caution</h3>
<p>For those of you who are new to InnoDB configuration and administration, be careful. InnoDB has to be told exactly what to do. If you do anything wrong, such as set the permissions wrong on InnoDB’s log or data files or directories, change the file sizes, or any of a bunch of other mistakes, it will be very unforgiving. It may even wipe your existing log and data files and replace them with new ones full of zeroes (yes, this will delete all your data).</p>
<p>The MySQL error log is your friend, but in many cases InnoDB doesn’t flush any output to it for a long time, so you might for example start MySQL and see “MySQL NOT started.” It might just be that InnoDB wasn’t shut down nicely and has to roll back transactions to get to a consistent state. If so, that information will show up in the log files, but it might take a Very Long Time.</p>
<h3>If you need help</h3>
<p>You can get help on the #mysql IRC channel, mailing lists, or just read the <a href="http://dev.mysql.com/doc/refman/5.0/en/index.html">MySQL manual</a>. I like the IRC channel best myself. It’s friendly and there are a lot of smart people there to answer your questions.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/grabameat.wordpress.com/159/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/grabameat.wordpress.com/159/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/grabameat.wordpress.com/159/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/grabameat.wordpress.com/159/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/grabameat.wordpress.com/159/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/grabameat.wordpress.com/159/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/grabameat.wordpress.com/159/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/grabameat.wordpress.com/159/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/grabameat.wordpress.com/159/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/grabameat.wordpress.com/159/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/grabameat.wordpress.com/159/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/grabameat.wordpress.com/159/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/grabameat.wordpress.com/159/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/grabameat.wordpress.com/159/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grabameat.wordpress.com&amp;blog=8513308&amp;post=159&amp;subd=grabameat&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://grabameat.wordpress.com/2009/11/10/what-to-do-when-mysql-says-skip-innodb-is-defined/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3f6ce70b3776ab061ca481c7ec80919c?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">grabameat</media:title>
		</media:content>
	</item>
		<item>
		<title>My.CNF MYISAM Configuration File (Best Used One)</title>
		<link>http://grabameat.wordpress.com/2009/11/10/my-cnf-configuration-file-best-used-one/</link>
		<comments>http://grabameat.wordpress.com/2009/11/10/my-cnf-configuration-file-best-used-one/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 22:10:59 +0000</pubDate>
		<dc:creator>grabameat</dc:creator>
				<category><![CDATA[Database Administration]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[MySql]]></category>
		<category><![CDATA[my.cnf]]></category>
		<category><![CDATA[MySql Configuration]]></category>

		<guid isPermaLink="false">http://grabameat.wordpress.com/?p=153</guid>
		<description><![CDATA[[mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock skip-innodb    # (if you don&#8217;t want to use INNODB Tables) max_connections = 500 key_buffer = 16M myisam_sort_buffer_size = 64M join_buffer_size = 1M read_buffer_size = 1M sort_buffer_size = 2M table_cache = 1024 thread_cache_size = 64 wait_timeout = 1800 connect_timeout = 10 max_allowed_packet = 16M max_connect_errors = 10 query_cache_limit = 1M query_cache_size = [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grabameat.wordpress.com&amp;blog=8513308&amp;post=153&amp;subd=grabameat&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h2><strong>[mysqld]</strong></h2>
<h2><strong> </strong><br />
<span style="color:#333399;"><span style="color:#0000ff;">datadir=/var/lib/mysql<br />
socket=/var/lib/mysql/mysql.sock<br />
skip-innodb    # <span style="color:#ff0000;">(if you don&#8217;t want to use INNODB Tables)</span><br />
max_connections = 500<br />
key_buffer = 16M<br />
myisam_sort_buffer_size = 64M<br />
join_buffer_size = 1M<br />
read_buffer_size = 1M<br />
sort_buffer_size = 2M<br />
table_cache = 1024<br />
thread_cache_size = 64<br />
wait_timeout = 1800<br />
connect_timeout = 10<br />
max_allowed_packet = 16M<br />
max_connect_errors = 10<br />
query_cache_limit = 1M<br />
query_cache_size = 32M<br />
query_cache_type = 1</span><br />
</span><br />
<strong>[mysqld_safe]</strong></h2>
<h2><span style="color:#800000;">err-log=/var/log/mysqld.log<br />
open_files_limit = 8192</span></h2>
<p><strong>[mysqldump]</strong><br />
<span style="color:#008000;"><strong> </strong></span></p>
<p><span style="color:#008000;"><strong>quick<br />
max_allowed_packet = 16M</strong></span></p>
<h2><strong>[myisamchk]</strong></h2>
<h2>key_buffer = 64M</h2>
<p><span style="color:#ff0000;"> </span></p>
<h2>sort_buffer = 64M</h2>
<h2>read_buffer = 16M</h2>
<h2>write_buffer = 16M</h2>
<h2>[mysql.server]</h2>
<h2>user=mysql</h2>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/grabameat.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/grabameat.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/grabameat.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/grabameat.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/grabameat.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/grabameat.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/grabameat.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/grabameat.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/grabameat.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/grabameat.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/grabameat.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/grabameat.wordpress.com/153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/grabameat.wordpress.com/153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/grabameat.wordpress.com/153/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grabameat.wordpress.com&amp;blog=8513308&amp;post=153&amp;subd=grabameat&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://grabameat.wordpress.com/2009/11/10/my-cnf-configuration-file-best-used-one/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3f6ce70b3776ab061ca481c7ec80919c?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">grabameat</media:title>
		</media:content>
	</item>
		<item>
		<title>Asynchronous Query Executed</title>
		<link>http://grabameat.wordpress.com/2009/11/10/asynchronous-query-executed/</link>
		<comments>http://grabameat.wordpress.com/2009/11/10/asynchronous-query-executed/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 06:04:31 +0000</pubDate>
		<dc:creator>grabameat</dc:creator>
				<category><![CDATA[Database Administration]]></category>
		<category><![CDATA[MySql]]></category>
		<category><![CDATA[MYSQL DBA]]></category>

		<guid isPermaLink="false">http://grabameat.wordpress.com/?p=148</guid>
		<description><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grabameat.wordpress.com&amp;blog=8513308&amp;post=148&amp;subd=grabameat&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div id="attachment_147" class="wp-caption alignnone" style="width: 831px"><a href="http://mysqldba.blogspot.com/"><img class="size-full wp-image-147" title="asynchronous query" src="http://grabameat.files.wordpress.com/2009/11/4090681457_d8a10f21ec_o.png?w=645" alt="How is the asynchronous query executed? Lets take a look at the figure below."   /></a><p class="wp-caption-text">How is the asynchronous query executed? Lets take a look at the figure below.</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/grabameat.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/grabameat.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/grabameat.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/grabameat.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/grabameat.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/grabameat.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/grabameat.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/grabameat.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/grabameat.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/grabameat.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/grabameat.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/grabameat.wordpress.com/148/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/grabameat.wordpress.com/148/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/grabameat.wordpress.com/148/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grabameat.wordpress.com&amp;blog=8513308&amp;post=148&amp;subd=grabameat&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://grabameat.wordpress.com/2009/11/10/asynchronous-query-executed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3f6ce70b3776ab061ca481c7ec80919c?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">grabameat</media:title>
		</media:content>

		<media:content url="http://grabameat.files.wordpress.com/2009/11/4090681457_d8a10f21ec_o.png" medium="image">
			<media:title type="html">asynchronous query</media:title>
		</media:content>
	</item>
		<item>
		<title>MySql Database Replication</title>
		<link>http://grabameat.wordpress.com/2009/11/09/mysql-database-replication/</link>
		<comments>http://grabameat.wordpress.com/2009/11/09/mysql-database-replication/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 18:36:14 +0000</pubDate>
		<dc:creator>grabameat</dc:creator>
				<category><![CDATA[Database Administration]]></category>
		<category><![CDATA[Database Security]]></category>
		<category><![CDATA[MySql]]></category>
		<category><![CDATA[MYSQL DBA]]></category>
		<category><![CDATA[Mysql Replication]]></category>

		<guid isPermaLink="false">http://grabameat.wordpress.com/?p=145</guid>
		<description><![CDATA[How To Set Up Database Replication In MySQL Version 1.1 Author: Falko Timme &#60;ft [at] falkotimme [dot] com&#62; Last edited: 01/14/2006 This tutorial describes how to set up database replication in MySQL. MySQL replication allows you to have an exact copy of a database from a master server on another server (slave), and all updates [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grabameat.wordpress.com&amp;blog=8513308&amp;post=145&amp;subd=grabameat&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:small;"><strong>How To Set Up Database Replication In MySQL</strong></span></p>
<p><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;">Version 1.1</span><br />
<span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;">Author: Falko Timme &lt;ft [at] falkotimme [dot] com&gt;</span><br />
<span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;">Last edited: 01/14/2006</span></p>
<p><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;">This tutorial describes how to set up database replication in MySQL. MySQL replication allows you to have an exact copy of a database from a master server on another server (slave), and all updates to the database on the master server are immediately replicated to the database on the slave server so that both databases are in sync. This is not a backup policy because an accidentally issued DELETE command will also be carried out on the slave; but replication can help protect against hardware failures though.</span></p>
<p><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;">In this tutorial I will show how to replicate the database <span style="font-family:'Courier New', Courier, mono;"><em>exampledb</em></span> from the master with the IP address <span style="font-family:'Courier New', Courier, mono;"><em>192.168.0.100</em></span> to a slave. Both systems (master and slave) are running <strong>Debian Sarge</strong>; however, the configuration should apply to almost all distributions with little or no modification.</span></p>
<p><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;">Both systems have MySQL installed, and the database <span style="font-family:'Courier New', Courier, mono;"><em>exampledb</em></span> with tables and data is already existing on the master, but not on the slave.</span></p>
<p><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;">I want to say first that this is not the only way of setting up such a system. There are many ways of achieving this goal but this is the way I take. I do not issue any guarantee that this will work for you!</span></p>
<p>&nbsp;</p>
<h4><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:small;">1 Configure The Master</span></h4>
<p><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;">First we have to edit <span style="font-family:'Courier New', Courier, mono;"><em>/etc/mysql/my.cnf</em></span>. We have to enable networking for MySQL, and MySQL should listen on all IP addresses, therefore we comment out these lines (if existant):</span></p>
<table border="1" cellspacing="0" cellpadding="2" width="90%" align="center" bgcolor="#cccccc">
<tbody>
<tr>
<td>
<pre>#skip-networking
#bind-address            = 127.0.0.1</pre>
</td>
</tr>
</tbody>
</table>
<p><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;">Furthermore we have to tell MySQL for which database it should write logs (these logs are used by the slave to see what has changed on the master), which log file it should use, and we have to specify that this MySQL server is the master. We want to replicate the database <span style="font-family:'Courier New', Courier, mono;"><em>exampledb</em></span>, so we put the following lines into <span style="font-family:'Courier New', Courier, mono;"><em>/etc/mysql/my.cnf</em></span>:</span></p>
<table border="1" cellspacing="0" cellpadding="2" width="90%" align="center" bgcolor="#cccccc">
<tbody>
<tr>
<td>
<pre>log-bin = /var/log/mysql/mysql-bin.log
binlog-do-db=exampledb
server-id=1</pre>
</td>
</tr>
</tbody>
</table>
<p><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;">Then we restart MySQL:</span></p>
<p>&nbsp;</p>
<p><span style="font-family:'Courier New', Courier, mono;"><em><span style="font-size:x-small;">/etc/init.d/mysql restart</span></em></span></p>
<p><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;">Then we log into the MySQL database as <span style="font-family:'Courier New', Courier, mono;"><em>root</em></span> and create a user with replication privileges:</span></p>
<p><span style="font-family:'Courier New', Courier, mono;"><em><span style="font-size:x-small;">mysql -u root -p<br />
Enter password:</span></em></span></p>
<p><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;">Now we are on the MySQL shell.</span></p>
<p><span style="font-family:'Courier New', Courier, mono;"><em><span style="font-size:x-small;">GRANT REPLICATION SLAVE ON *.* TO &#8216;slave_user&#8217;@'%&#8217; IDENTIFIED BY &#8216;&lt;some_password&gt;&#8217;; </span></em><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;">(Replace <span style="font-family:'Courier New', Courier, mono;"><em>&lt;some_password&gt;</em></span> with a real password!)</span><span style="font-size:x-small;"><em><br />
FLUSH PRIVILEGES;</em></span></span></p>
<p><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;">Next (still on the MySQL shell) do this:</span></p>
<p><span style="font-family:'Courier New', Courier, mono;"><em><span style="font-size:x-small;">USE exampledb;<br />
FLUSH TABLES WITH READ LOCK;<br />
SHOW MASTER STATUS;</span></em></span></p>
<p><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;">The last command will show something like this:</span></p>
<table border="1" cellspacing="0" cellpadding="2" width="90%" align="center" bgcolor="#cccccc">
<tbody>
<tr>
<td>
<pre>+---------------+----------+--------------+------------------+
| File          | Position | Binlog_do_db | Binlog_ignore_db |
+---------------+----------+--------------+------------------+
| mysql-bin.006 | 183      | exampledb    |                  |
+---------------+----------+--------------+------------------+
1 row in set (0.00 sec)</pre>
</td>
</tr>
</tbody>
</table>
<p><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;">Write down this information, we will need it later on the slave!</span></p>
<p><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;">Then leave the MySQL shell:</span></p>
<p><span style="font-family:'Courier New', Courier, mono;font-size:x-small;"><em>quit;</em></span></p>
<hr /><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;">There are two possibilities to get the existing tables and data from <span style="font-family:'Courier New', Courier, mono;"><em>exampledb</em></span> from the master to the slave. The first one is to make a database dump, the second one is to use the</span> <span style="font-family:'Courier New', Courier, mono;font-size:x-small;"><em>LOAD DATA FROM MASTER;</em></span> <span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;">command on the slave. The latter has the disadvantage the the database on the master will be <strong>locked</strong> during this operation, so if you have a large database on a high-traffic production system, this is not what you want, and I recommend to follow the first method in this case. However, the latter method is very fast, so I will describe both here.</span></p>
<p><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;">If you want to follow the first method, then do this:</span></p>
<p><span style="font-family:'Courier New', Courier, mono;"><em><span style="font-size:x-small;">mysqldump -u root -p&lt;password&gt; &#8211;opt exampledb &gt; exampledb.sql </span></em><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;">(Replace <span style="font-family:'Courier New', Courier, mono;"><em>&lt;password&gt;</em></span> with the real password for the MySQL user <span style="font-family:'Courier New', Courier, mono;"><em>root</em></span>! <strong>Important:</strong> There is <strong>no</strong>space between <span style="font-family:'Courier New', Courier, mono;"><em>-p</em></span> and <span style="font-family:'Courier New', Courier, mono;"><em>&lt;password&gt;</em></span>!)</span></span></p>
<p><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;">This will create an SQL dump of <span style="font-family:'Courier New', Courier, mono;"><em>exampledb</em></span> in the file <span style="font-family:'Courier New', Courier, mono;"><em>exampledb.sql</em></span>. Transfer this file to your slave server!</span></p>
<p><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;">If you want to go the <span style="font-family:'Courier New', Courier, mono;"><em>LOAD DATA FROM MASTER;</em></span> way then there is nothing you must do right now.</span></p>
<hr /><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;">Finally we have to unlock the tables in <span style="font-family:'Courier New', Courier, mono;"><em>exampledb</em></span>:</span></p>
<p><span style="font-family:'Courier New', Courier, mono;"><em><span style="font-size:x-small;">mysql -u root -p<br />
Enter password:<br />
UNLOCK TABLES;<br />
quit;</span></em></span></p>
<p><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;">Now the configuration on the master is finished. On to the slave&#8230;</span></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:small;"><strong>2 Configure The Slave</strong></span></p>
<p><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;">On the slave we first have to create the database <span style="font-family:'Courier New', Courier, mono;"><em>exampledb</em></span>:</span></p>
<p><span style="font-family:'Courier New', Courier, mono;"><em><span style="font-size:x-small;">mysql -u root -p<br />
Enter password:<br />
CREATE DATABASE exampledb;<br />
quit;</span></em></span></p>
<hr /><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;">If you have made an SQL dump of <span style="font-family:'Courier New', Courier, mono;"><em>exampledb</em></span> on the master and have transferred it to the slave, then it is time now to import the SQL dump into our newly created <span style="font-family:'Courier New', Courier, mono;"><em>exampledb</em></span> on the slave:</span></p>
<p><span style="font-family:'Courier New', Courier, mono;"><em><span style="font-size:x-small;">mysql -u root -p&lt;password&gt; exampledb &lt; /path/to/exampledb.sql </span></em><span style="font-family:'Courier New', Courier, mono;"><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;">(Replace <span style="font-family:'Courier New', Courier, mono;"><em>&lt;password&gt;</em></span> with the real password for the MySQL user <span style="font-family:'Courier New', Courier, mono;">root</span>! <strong>Important:</strong> There is <strong>no</strong> space between <em><span style="font-family:'Courier New', Courier, mono;">-p</span></em> and <span style="font-family:'Courier New', Courier, mono;"><em>&lt;password&gt;</em></span>!)</span></span></span></p>
<p><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;">If you want to go the <span style="font-family:'Courier New', Courier, mono;"><em>LOAD DATA FROM MASTER;</em></span> way then there is nothing you must do right now.</span></p>
<hr /><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;">Now we have to tell MySQL on the slave that it is the slave, that the master is <span style="font-family:'Courier New', Courier, mono;"><em>192.168.0.100</em></span>, and that the master database to watch is <span style="font-family:'Courier New', Courier, mono;"><em>exampledb</em></span>. Therefore we add the following lines to <span style="font-family:'Courier New', Courier, mono;"><em>/etc/mysql/my.cnf</em></span>:</span></p>
<table border="1" cellspacing="0" cellpadding="2" width="90%" align="center" bgcolor="#cccccc">
<tbody>
<tr>
<td>
<pre>server-id=2
master-host=192.168.0.100
master-user=slave_user
master-password=secret
master-connect-retry=60
replicate-do-db=exampledb</pre>
</td>
</tr>
</tbody>
</table>
<p><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;">Then we restart MySQL:</span></p>
<p><span style="font-size:x-small;"><em><span style="font-family:'Courier New', Courier, mono;">/etc/init.d/mysql restart</span></em></span></p>
<hr /><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;">If you have not imported the master <span style="font-family:'Courier New', Courier, mono;"><em>exampledb</em></span> with the help of an SQL dump, but want to go the <span style="font-family:'Courier New', Courier, mono;"><em>LOAD DATA FROM MASTER;</em></span> way, then it is time for you now to get the data from the master <span style="font-family:'Courier New', Courier, mono;"><em>exampledb</em></span>:</span></p>
<p><span style="font-family:'Courier New', Courier, mono;"><em><span style="font-size:x-small;">mysql -u root -p<br />
Enter password:<br />
LOAD DATA FROM MASTER;<br />
quit;</span></em></span></p>
<p><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;">If you have <a href="http://www.phpmyadmin.net/" target="_blank">phpMyAdmin</a> installed on the slave you can now check if all tables/data from the master <span style="font-family:'Courier New', Courier, mono;"><em>exampledb</em></span> is also available on the slave <span style="font-family:'Courier New', Courier, mono;"><em>exampledb</em></span>.</span></p>
<hr /><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;">Finally, we must do this:</span></p>
<p><span style="font-size:x-small;"><em><span style="font-family:'Courier New', Courier, mono;">mysql -u root -p<br />
Enter password:<br />
SLAVE STOP;</span></em></span></p>
<p><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;">In the next command (still on the MySQL shell) you have to replace the values appropriately:</span></p>
<p><span style="font-family:'Courier New', Courier, mono;"><em><span style="font-size:x-small;">CHANGE MASTER TO MASTER_HOST=&#8217;192.168.0.100&#8242;, MASTER_USER=&#8217;slave_user&#8217;, MASTER_PASSWORD=&#8217;</span><span style="font-family:'Courier New', Courier, mono;"><em><span style="font-size:x-small;">&lt;some_password&gt;</span></em></span><span style="font-size:x-small;">&#8216;, MASTER_LOG_FILE=&#8217;mysql-bin.006&#8242;, MASTER_LOG_POS=183;</span></em></span></p>
<p>&nbsp;</p>
<ul>
<li><em><span style="font-family:'Courier New', Courier, mono;font-size:x-small;">MASTER_HOST</span></em> <span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;">is the IP address or hostname of the master (in this example it is</span> <span style="font-family:'Courier New', Courier, mono;font-size:x-small;"><em>192.168.0.100</em></span><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;">).</span></li>
<li><em><span style="font-family:'Courier New', Courier, mono;font-size:x-small;">MASTER_USER</span></em><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;"> is the user we granted replication privileges on the master.</span></li>
<li><em><span style="font-family:'Courier New', Courier, mono;font-size:x-small;">MASTER_PASSWORD</span></em> <span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;">is the password of</span> <span style="font-family:'Courier New', Courier, mono;font-size:x-small;"><em>MASTER_USER</em></span> <span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;">on the master.</span></li>
<li><em><span style="font-family:'Courier New', Courier, mono;font-size:x-small;">MASTER_LOG_FILE</span></em> <span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;">is the file MySQL gave back when you ran</span> <span style="font-family:'Courier New', Courier, mono;"><em><span style="font-size:x-small;">SHOW MASTER STATUS;</span></em></span> <span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;">on the master.</span></li>
<li><em><span style="font-family:'Courier New', Courier, mono;font-size:x-small;">MASTER_LOG_POS</span></em> <span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;">is the position MySQL gave back when you ran</span> <span style="font-family:'Courier New', Courier, mono;"><em><span style="font-size:x-small;">SHOW MASTER STATUS;</span></em></span><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;"> on the master.</span></li>
</ul>
<p><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;">Now all that is left to do is start the slave. Still on the MySQL shell we run</span></p>
<p><span style="font-family:'Courier New', Courier, mono;"><em><span style="font-size:x-small;">START SLAVE;<br />
quit;</span></em></span></p>
<p><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:x-small;">That&#8217;s it! Now whenever <span style="font-family:'Courier New', Courier, mono;"><em>exampledb</em></span> is updated on the master, all changes will be replicated to <span style="font-family:'Courier New', Courier, mono;"><em>exampledb</em></span> on the slave. Test it!</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/grabameat.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/grabameat.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/grabameat.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/grabameat.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/grabameat.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/grabameat.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/grabameat.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/grabameat.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/grabameat.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/grabameat.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/grabameat.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/grabameat.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/grabameat.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/grabameat.wordpress.com/145/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grabameat.wordpress.com&amp;blog=8513308&amp;post=145&amp;subd=grabameat&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://grabameat.wordpress.com/2009/11/09/mysql-database-replication/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3f6ce70b3776ab061ca481c7ec80919c?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">grabameat</media:title>
		</media:content>
	</item>
		<item>
		<title>Ramblings on MYSQL Administration</title>
		<link>http://grabameat.wordpress.com/2009/11/06/ramblings-on-mysql-administration/</link>
		<comments>http://grabameat.wordpress.com/2009/11/06/ramblings-on-mysql-administration/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 17:14:08 +0000</pubDate>
		<dc:creator>grabameat</dc:creator>
				<category><![CDATA[Database Administration]]></category>
		<category><![CDATA[MySql]]></category>
		<category><![CDATA[MYSQL DBA]]></category>
		<category><![CDATA[mysql performance]]></category>

		<guid isPermaLink="false">http://grabameat.wordpress.com/?p=129</guid>
		<description><![CDATA[MY.CNF Configuration file The configuration file supports options for multiple programs. Each program has its own directive, which is a keyword in square brackets, such as [mysqld] or [client]. Here is a sample configuration file from a production system: # The following options will be passed to all MySQL clients [client] port = 3306 socket = /var/lib/mysql/mysql.sock [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grabameat.wordpress.com&amp;blog=8513308&amp;post=129&amp;subd=grabameat&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h1 style="text-align:center;"><strong><span style="color:#800000;"><span style="text-decoration:underline;">MY.CNF Configuration file</span></span></strong></h1>
<p><strong><span style="color:#800000;"><span style="font-weight:normal;">The configuration file supports options for multiple programs. Each program has its own directive, which is a keyword in square brackets, such as [mysqld] or [client]. Here is a sample configuration file from a production system: </span></span></strong></p>
<p><strong><span style="font-weight:normal;"># The following options will be passed to all MySQL clients</span></strong></p>
<p><strong><span style="font-weight:normal;"><span style="color:#0000ff;">[client]</span></span></strong></p>
<p><strong><span style="color:#0000ff;"> </span></strong></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">port = 3306</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">socket = /var/lib/mysql/mysql.sock</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">[mysqld]</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">#this will prevent mysql from starting</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">port = 3306</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">socket = /var/lib/mysql/mysql.sock</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">datadir =/var/lib/mysql</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">log_slow_queries = /var/log/mysql/mysqld_slow-queries.log</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">long_query_time = 4</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">max_connections=200</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">max_connect_errors = 400</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">wait_timeout=7200</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">connect_timeout=10</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">key_buffer = 512M</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">tmp_table_size = 32M</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">max_heap_table_size = 32M</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">max_allowed_packet = 32M</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">table_cache = 1800</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">join_buffer_size = 8M</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">sort_buffer_size = 16M</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">read_buffer_size = 8M</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">read_rnd_buffer_size = 524288</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">myisam_sort_buffer_size = 256M</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">thread_cache_size = 384</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">bulk_insert_buffer_size = 8M</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">query_cache_limit = 4M</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">query_cache_size = 128M</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">query_cache_type = 1</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">362</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">MySQL Server Tuning 10</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">query_prealloc_size = 65536</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">query_alloc_block_size = 131072</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;"># Try number of CPU’s*2 for thread_concurrency</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">thread_concurrency = 4</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">#innodb configuration</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">innodb_data_home_dir = /mysql/data</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">innodb_data_file_path=ibdata1:200M:autoextend</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">innodb_log_group_home_dir = /mysql/data/data</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">innodb_log_arch_dir = /mysql/data/data</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">innodb_buffer_pool_size = 24576M</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">innodb_additional_mem_pool_size = 32M</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">innodb_log_file_size = 1024M</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">innodb_log_files_in_group = 2</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">innodb_log_buffer_size = 16M</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">innodb_flush_log_at_trx_commit = 1</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">innodb_lock_wait_timeout = 120</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">sync-binlog = 1</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">innodb_support_xa = 0</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">innodb_thread_concurrency = 128</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">innodb_file_per_table</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;"># binary logging is required for replication</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">log-bin=mysql-bin</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">max_binlog_size = 1024M</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">server-id = 4</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">slave-skip-errors = 1062</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">expire-logs-days = 7</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">[mysqldump]</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">quick</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">max_allowed_packet = 16M</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">[mysql.server]</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">user=mysql</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">group=mysql</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">basedir=/var/lib</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">[mysqld_safe]</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">nice = -5</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">open_files_limit = 8192</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">log-error=/var/log/mysql/mysqld.log</span></span></p>
<p><span style="font-weight:normal;"><span style="color:#0000ff;">pid-file=/var/run/mysqld/mysqld.pid</span></span></p>
<p><span style="text-decoration:underline;"><br />
</span></p>
<p style="text-align:center;"><strong><span style="text-decoration:underline;">RAID<br />
</span><span style="font-weight:normal;">(Redundant Array of Independent Disks)</span></strong></p>
<p style="text-align:left;">Raid 0 (zero): Only One Copy of Data spread out into Multiple Disks. if One copy Lost all the Data is Lost.</p>
<p style="text-align:left;">Raid 1 : Two Disks Mirrored if one fails Other will Pickup.</p>
<p style="text-align:left;">Raid 5: Combines Three of more Disks.  Storage Capacity is Reduced by One Disk.</p>
<p style="text-align:left;">Raid 10: Combination of Raid 1 and 0 Storage Capacity &#8211; 50% Mirrored.</p>
<p style="text-align:center;">Linux:</p>
<p style="text-align:justify;">LVM: Logical Volume Manager: Which will Separate Log Files on a Different Server.</p>
<p style="text-align:center;"><strong><span style="text-decoration:underline;">File System</span></strong></p>
<p style="text-align:left;"><strong><span style="text-decoration:underline;">EXT 2: </span><span style="font-weight:normal;"> Good Perfoermance &amp; Slower Crash Recovery.</span></strong></p>
<p style="text-align:left;"><strong><span style="font-weight:normal;">EXT 3:  Good Performance over EXT2 Filer System.</span></strong></p>
<p style="text-align:left;"><strong><span style="font-weight:normal;">IBM JFS:  Fast Recovery After a file System Failure.</span></strong></p>
<p style="text-align:center;">
<p style="text-align:center;"><strong><span style="text-decoration:underline;">Tuning MYSQL Server</span></strong></p>
<p style="text-align:left;">Show Innodb Status: Which will show all the Status Information of Tables, Queries, Locks, Memory Usage, Memory Dumps, Cache, Flushed Transactions, Thread information Etc.</p>
<p style="text-align:left;">
<div id="_mcePaste"><span style="color:#ff9900;">show innodb status;</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">=====================================</span></div>
<div id="_mcePaste"><span style="color:#ff0000;">091105 14:08:54 INNODB MONITOR OUTPUT</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">=====================================</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">Per second averages calculated from the last 15 seconds</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">&#8212;&#8212;&#8212;-</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">SEMAPHORES</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">&#8212;&#8212;&#8212;-</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">OS WAIT ARRAY INFO: reservation count 107862, signal count 107846</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">Mutex spin waits 0, rounds 9648346, OS waits 26394</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">RW-shared spins 140432, OS waits 70114; RW-excl spins 63, OS waits 54</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">&#8212;&#8212;&#8212;&#8212;</span></div>
<div id="_mcePaste"><span style="color:#0000ff;">TRANSACTIONS</span></div>
<div id="_mcePaste"><span style="color:#0000ff;">&#8212;&#8212;&#8212;&#8212;</span></div>
<div id="_mcePaste"><span style="color:#0000ff;">Trx id counter 0 966751765</span></div>
<div id="_mcePaste"><span style="color:#0000ff;">Purge done for trx&#8217;s n:o &lt; 0 966751662 undo n:o &lt; 0 0</span></div>
<div id="_mcePaste"><span style="color:#0000ff;">History list length 13</span></div>
<div id="_mcePaste"><span style="color:#0000ff;">LIST OF TRANSACTIONS FOR EACH SESSION:</span></div>
<div id="_mcePaste"><span style="color:#0000ff;">&#8212;TRANSACTION 0 0, not started, process no 26454, OS thread id 2923674480</span></div>
<div id="_mcePaste"><span style="color:#0000ff;">MySQL thread id 466090, query id 8924458 c-24-6-189-185.hsd1.ca.comcast.net 24.6.189.185 HTN</span></div>
<div id="_mcePaste"><span style="color:#0000ff;">show innodb status</span></div>
<div id="_mcePaste"><span style="color:#0000ff;">&#8212;TRANSACTION 0 966751278, not started, process no 26454, OS thread id 2968963952</span></div>
<div id="_mcePaste"><span style="color:#0000ff;">MySQL thread id 466080, query id 8921005 192.168.10.79 HTN</span></div>
<div id="_mcePaste"><span style="color:#0000ff;">&#8212;TRANSACTION 0 0, not started, process no 26454, OS thread id 2946497392</span></div>
<div id="_mcePaste"><span style="color:#0000ff;">MySQL thread id 466077, query id 8922846 75.7.48.50 HTN</span></div>
<div id="_mcePaste"><span style="color:#0000ff;">&#8212;TRANSACTION 0 966751530, not started, process no 26454, OS thread id 3021794160</span></div>
<div id="_mcePaste"><span style="color:#0000ff;">MySQL thread id 465759, query id 8922979 192.168.10.78 HTN</span></div>
<div id="_mcePaste"><span style="color:#0000ff;">&#8212;TRANSACTION 0 0, not started, process no 26454, OS thread id 3076823920</span></div>
<div id="_mcePaste"><span style="color:#0000ff;">MySQL thread id 466068, query id 8920769 75.7.48.50 HTN</span></div>
<div id="_mcePaste"><span style="color:#0000ff;">&#8212;TRANSACTION 0 0, not started, process no 26454, OS thread id 2943998832</span></div>
<div id="_mcePaste"><span style="color:#0000ff;">MySQL thread id 466051, query id 8920551 75.7.48.50 HTN</span></div>
<div id="_mcePaste"><span style="color:#0000ff;">&#8212;TRANSACTION 0 0, not started, process no 26454, OS thread id 2938555248</span></div>
<div id="_mcePaste"><span style="color:#0000ff;">MySQL thread id 466021, query id 8920902 75.7.48.50 HTN</span></div>
<div id="_mcePaste"><span style="color:#0000ff;">&#8212;TRANSACTION 0 0, not started, process no 26454, OS thread id 2938956656</span></div>
<div id="_mcePaste"><span style="color:#0000ff;">MySQL thread id 465966, query id 8920351 192.168.10.79 HTN</span></div>
<div id="_mcePaste"><span style="color:#0000ff;">&#8212;TRANSACTION 0 0, not started, process no 26454, OS thread id 3077024624</span></div>
<div id="_mcePaste"><span style="color:#0000ff;">MySQL thread id 465757, query id 8921477 192.168.10.78 HTN</span></div>
<div id="_mcePaste"><span style="color:#0000ff;">&#8212;TRANSACTION 0 966751014, not started, process no 26454, OS thread id 2969365360</span></div>
<div id="_mcePaste"><span style="color:#0000ff;">MySQL thread id 465566, query id 8921004 192.168.10.79 HTN</span></div>
<div id="_mcePaste"><span style="color:#0000ff;">&#8212;TRANSACTION 0 0, not started, process no 26454, OS thread id 2900405104</span></div>
<div id="_mcePaste"><span style="color:#0000ff;">MySQL thread id 465514, query id 8902812 192.168.10.52 HTN</span></div>
<div id="_mcePaste"><span style="color:#0000ff;">&#8212;TRANSACTION 0 966751013, not started, process no 26454, OS thread id 2944400240</span></div>
<div id="_mcePaste"><span style="color:#0000ff;">MySQL thread id 465472, query id 8919475 192.168.10.79 HTN</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">&#8212;&#8212;&#8211;</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">FILE I/O</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">&#8212;&#8212;&#8211;</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">I/O thread 0 state: waiting for i/o request (insert buffer thread)</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">I/O thread 1 state: waiting for i/o request (log thread)</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">I/O thread 2 state: waiting for i/o request (read thread)</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">I/O thread 3 state: waiting for i/o request (write thread)</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">Pending normal aio reads: 0, aio writes: 0,</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">ibuf aio reads: 0, log i/o&#8217;s: 0, sync i/o&#8217;s: 0</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">Pending flushes (fsync) log: 0; buffer pool: 0</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">86187 OS file reads, 11907 OS file writes, 10888 OS fsyncs</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">0.00 reads/s, 0 avg bytes/read, 1.47 writes/s, 0.47 fsyncs/s</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">INSERT BUFFER AND ADAPTIVE HASH INDEX</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">Ibuf: size 1, free list len 60, seg size 62,</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">246 inserts, 246 merged recs, 39 merges</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">Hash table size 34679, node heap has 4 buffer(s)</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">6.53 hash searches/s, 6.53 non-hash searches/s</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">&#8212;</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">LOG</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">&#8212;</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">Log sequence number 5 2711071627</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">Log flushed up to   5 2711071627</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">Last checkpoint at  5 2711071627</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">0 pending log writes, 0 pending chkp writes</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">8299 log i/o&#8217;s done, 0.20 log i/o&#8217;s/second</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">BUFFER POOL AND MEMORY</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">Total memory allocated 21219654; in additional pool allocated 1048576</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">Dictionary memory allocated 2740496</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">Buffer pool size   512</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">Free buffers       1</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">Database pages     507</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">Modified db pages  0</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">Pending reads 0</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">Pending writes: LRU 0, flush list 0, single page 0</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">Pages read 1127608, created 33, written 2585</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">0.00 reads/s, 0.00 creates/s, 1.20 writes/s</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">Buffer pool hit rate 1000 / 1000</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">&#8212;&#8212;&#8212;&#8212;&#8211;</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">ROW OPERATIONS</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">&#8212;&#8212;&#8212;&#8212;&#8211;</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">0 queries inside InnoDB, 0 queries in queue</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">1 read views open inside InnoDB</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">Main thread process no. 26454, id 2987748208, state: sleeping</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">Number of rows inserted 1553, updated 618, deleted 299, read 293174006</span></div>
<div id="_mcePaste"><span style="color:#ff9900;">0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 150.26 reads/s</span></div>
<div id="_mcePaste"><span style="color:#ff9900;"><strong><span style="color:#ff0000;">&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</span></strong></span></div>
<div id="_mcePaste"><span style="color:#ff9900;"><strong><span style="color:#ff0000;">END OF INNODB MONITOR OUTPUT</span></strong></span></div>
<div id="_mcePaste"><span style="color:#ff9900;"><strong><span style="color:#ff0000;">============================</span></strong></span></div>
<p><span style="color:#ff9900;"><span style="color:#000000;">SHOW VARIABLES: Displays all variables and the usage    ex: Show Global Variables Like &#8216;%tmp%/&#8217;</span></span></p>
<p><span style="color:#ff9900;"><span style="color:#000000;"> </span></span></p>
<p><span style="color:#800080;">By default, SHOW STATUS will show SESSION variables. This may or may not be your intention, so to avoid confusion, always specify GLOBAL or SESSION as a keyword.</span></p>
<p><span style="color:#ff9900;"><span style="color:#000000;"> </span></span></p>
<p><strong><span style="color:#800080;">mysql&gt; SHOW GLOBAL STATUS LIKE ’%tmp%’;</span></strong></p>
<p><span style="color:#800080;">+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;+</span></p>
<p><span style="color:#800080;">| Variable_name | Value |</span></p>
<p><span style="color:#800080;">+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;+</span></p>
<p><span style="color:#800080;">| Created_tmp_disk_tables | 2744623 |</span></p>
<p><span style="color:#800080;">| Created_tmp_files | 147344 |</span></p>
<p><span style="color:#800080;">| Created_tmp_tables | 5003238 |</span></p>
<p><span style="color:#800080;">+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;+</span></p>
<p><span style="color:#800080;"> </span></p>
<p><span style="color:#008000;">The SHOW VARIABLES can be used to determine the values of system variables. This is a very useful command when tuning a server. As with the SHOW STATUS command, it can use the LIKE modifier, and you should always specify GLOBAL or SESSION to avoid possible confusion. </span></p>
<p><span style="color:#008000;">If you wanted to see the global settings for temporary tables:</span></p>
<p><span style="color:#008000;"><strong>mysql&gt; SHOW GLOBAL VARIABLES LIKE ’%tmp\_%’;</strong></span></p>
<p><span style="color:#008000;">+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;-+</span></p>
<p><span style="color:#008000;">| Variable_name | Value |</span></p>
<p><span style="color:#008000;">+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;-+</span></p>
<p><span style="color:#008000;">| max_tmp_tables | 32 |</span></p>
<p><span style="color:#008000;">| tmp_table_size | 33554432 |</span></p>
<p><span style="color:#008000;">+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;-+</span></p>
<p><span style="color:#008000;">&#8220;max_tmp_tables&#8221;,&#8221;32&#8243;</span></p>
<p><span style="color:#008000;">&#8220;slave_load_tmpdir&#8221;,&#8221;/tmp&#8221;</span></p>
<p><span style="color:#008000;">&#8220;tmp_table_size&#8221;,&#8221;16777216&#8243;</span></p>
<p><span style="color:#008000;">&#8220;tmpdir&#8221;,&#8221;/tmp&#8221;</span></p>
<h1 style="text-align:center;"><span style="color:#000000;"><span style="text-decoration:underline;"><span style="color:#800000;">INNODB Performance Tuning  Parameters</span></span></span></h1>
<p>INNODB_BUFFER_POOL_SIZE : 70-80% memory can be allocated to Buffer Pool size, Set it to 12gb on a 16gb box.</p>
<p>INNODB_LOG_FILE_SIZE:  This Depends on your Recovery Speed but 256mb Seems to be a good balance between Reasonable Recovery and Good Time Performance.</p>
<p>INNODB_LOG_BUFFER_SIZE: This can be Set to the</p>
<p>INNODB_FLUSH_LOG_AT_TRX_COMMAND: Works good before Server Crashes.</p>
<p>INNODB_THREAD_CONCURRENCY: 8</p>
<p>INNODB_FLUSH_METHOD: O-Direct</p>
<p><span style="color:#008000;">INNODB_FILE_PER_TABLE: </span></p>
<p><span style="color:#008000;"><strong>Transaction Isolation: Read Committed: This Option has some performance Benefits especially in locking in 5.0 and Even more to come with MySQL 5.1 and Row Level Application</strong></span></p>
<p style="text-align:center;"><strong><span style="text-decoration:underline;"><span style="color:#800000;">Application Tuning for INNODB:</span></span></strong></p>
<p><span style="color:#008000;">ERROR log:  Sql Daemon Start Stop, Critical Errors will be Logged in this Error Log File</span></p>
<p><span style="color:#008000;">Binary Log: Update, Delete, Insert,  Statements will be logged to Binary Log file.</span></p>
<p><span style="color:#008000;">General Query Log:  All Select Queries, general data retrieval queries will be recorded.</span></p>
<p><span style="color:#008000;">Slow Query Log:  Queries which are running slow and can be logged in to the file</span><span style="font-family:sans-serif;color:#202020;"><span style="line-height:25px;font-size:medium;">.<br />
<span style="color:#000000;font-family:Verdana, Arial, Helvetica, sans-serif;line-height:normal;font-size:small;"> </span></span></span></p>
<p><span style="color:#800080;">To activate the query log, simply place:<br />
</span><em><span style="color:#800080;">log-slow-queries = [slow_query_log_filename]</span></em><span style="color:#800080;"><br />
in your configuration file (my.cnf or my.ini), </span><em><span style="color:#800080;">slow_query_log_filename</span></em><span style="color:#800080;"> being the optional filename for your log file. If you don&#8217;t supply a filename, the default name will be used, which is the name of the host machine, with </span><em><span style="color:#800080;">-slow.log</span></em><span style="color:#800080;"> being appended.</span></p>
<p><span style="color:#800080;">The slow query log logs all queries that take longer than </span><em><span style="color:#800080;">long_query_time</span></em><span style="color:#800080;">, which is usually 10 seconds by default (more than long enough for a self-respecting query to complete). You can alter the long_query_time in the configuration file. The following example sets the time to 5 seconds:<br />
</span><em><span style="color:#800080;">set-variable = long_query_time = 5</span></em><span style="color:#800080;"><br />
The slow query log can also optionally log all queries that don&#8217;t use an index by placing the following in the configuration file:<br />
</span></p>
<p><em><span style="color:#800080;">log-long-format</span></em></p>
<p><span style="color:#008000;"><span style="color:#202020;font-family:sans-serif;line-height:25px;font-size:14px;"><strong><span style="color:#202020;font-family:sans-serif;font-style:normal;">s of MySQL 5.1.6, the destination can be a file or a table, or both</span><a style="background-image:initial;background-repeat:initial;background-attachment:initial;background-color:transparent;text-decoration:underline;color:blue;background-position:initial initial;" title="4.3.1. mysqld — The MySQL Server" href="http://dev.mysql.com/doc/refman/5.1/en/mysqld.html"><br />
mysqld</a></strong> with the <a style="background-image:initial;background-repeat:initial;background-attachment:initial;background-color:transparent;text-decoration:underline;color:blue;background-position:initial initial;" href="http://dev.mysql.com/doc/refman/5.1/en/server-options.html#option_mysqld_log-slow-queries"><code class="option" style="color:#0e4075;font-size:13px;background-color:white;font-weight:normal;font-family:monospace, fixed;">--log-slow-queries[=<em><code style="color:#026789;font-size:13px;background-color:#cccccc;font-weight:normal;font-family:monospace, fixed;padding:1px;">file_name</code></em>]</code></a> option to enable the slow query log, and optionally use <a style="background-image:initial;background-repeat:initial;background-attachment:initial;background-color:transparent;text-decoration:underline;color:blue;background-position:initial initial;" href="http://dev.mysql.com/doc/refman/5.1/en/server-options.html#option_mysqld_log-output"><code class="option" style="color:#0e4075;font-size:13px;background-color:white;font-weight:normal;font-family:monospace, fixed;">--log-output</code></a> to specify the log destination (as described in <a style="background-image:initial;background-repeat:initial;background-attachment:initial;background-color:transparent;text-decoration:underline;color:blue;background-position:initial initial;" title="5.2.1. Selecting General Query and Slow Query Log Output Destinations" href="http://dev.mysql.com/doc/refman/5.1/en/log-tables.html">Section 5.2.1, “Selecting General Query and Slow Query Log Output Destinations”</a>).</span></span></p>
<p><span style="color:#008000;"><span style="color:#202020;font-family:sans-serif;line-height:25px;font-size:14px;"><strong>Tee:  Turns on MYSQL Logging  to a specified file. ex: Tee / Filename,<br />
NoTee:  Will stop logging mysql.</strong></span></span></p>
<h2 style="text-align:center;"><strong><span style="text-decoration:underline;"><span style="color:#800000;">Memory Storage Engine Configuration</span></span></strong></h2>
<p><span style="color:#800000;"><strong><span style="color:#ff0000;">max_heap_table_size:</span></strong> The Maximum size of memory tables is limited by the system variable, it has a default value of 16 mega bytes.</span></p>
<p><span style="color:#800000;"><strong><span style="color:#ff0000;">Init_File: </span> </strong>This can be used to specify a file to use to populate a memory table  when mysqld starts, for ex: the file may contain LOAD DATA INFILE Command.</span></p>
<p><span style="color:#008000;"><span style="color:#202020;font-family:sans-serif;line-height:25px;font-size:14px;"><strong>Maria Storage Engine is a Crash Safe Version of MYISAM.</strong></span></span></p>
<h1 style="text-align:center;"><span style="color:#008000;"><span style="color:#202020;font-family:sans-serif;line-height:25px;font-size:14px;"><strong><span style="color:#ff6600;"><span style="text-decoration:underline;">Overall MySQL Server Options</span></span></strong></span></span></h1>
<p><span style="color:#008000;"><span style="color:#202020;font-family:sans-serif;line-height:25px;font-size:14px;"><strong><span style="color:#ff6600;"> </span></strong></span></span></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<h2><span style="color:#800000;"><span style="font-weight:normal;font-size:medium;">
<p>&nbsp;</p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:12pt;font-family:&amp;">Overall MySQL Server Options</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:8pt;font-family:&amp;">Option Name Global or</span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:small;"><span style="font-size:8.5pt;font-family:IndyCode;"><strong>memlock </strong></span><span style="font-size:8.5pt;font-family:&amp;"><strong>Global<br />
<span style="font-family:Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;font-weight:normal;font-size:small;"><span style="font-size:8.5pt;font-family:&amp;">Locks the </span><span style="font-size:8.5pt;font-family:IndyCode;">mysqld </span><span style="font-size:8.5pt;font-family:&amp;">daemon into server memory. While this can improve performance if the server <span style="font-family:Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;font-size:small;"><span style="font-size:8.5pt;font-family:&amp;">runs out of RAM, the </span><span style="font-size:8.5pt;font-family:IndyCode;">mysqld </span><span style="font-size:8.5pt;font-family:&amp;">daemon will crash.</span></span></span></span></strong></span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:8.5pt;font-family:&amp;"><span style="font-family:IndyCode;"><strong>sort_buffer_size = buffer_size</strong><br />
<span style="font-family:Optima, sans-serif;">Session Determines the amount of system memory allocated for SQL sorts. If this size is exceeded, the server will use hard drive space for sorting data.</span></span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:8.5pt;font-family:IndyCode;"><strong>thread_cache_size = num_of_threads</strong><br />
<span style="font-family:Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;font-size:small;"><span style="font-size:8.5pt;font-family:&amp;">Global </span><span style="font-size:8.5pt;font-family:IndyCode;">mysqld </span><span style="font-size:8.5pt;font-family:&amp;">creates a cache of unused connection threads rather than destroying threads and creating new ones as need.</span></span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:8.5pt;font-family:IndyCode;"><span style="font-family:Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;font-size:small;"><span style="font-size:8.5pt;font-family:IndyCode;"><strong>thread_concurrency = N </strong></span><span style="font-size:8.5pt;font-family:&amp;"><strong>Global</strong><br />
Only use on Solaris systems. This should typically be set to twice the number of CPUs. It should be tested carefully before using in production.</span></span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;"><span style="font-size:8.5pt;font-family:IndyCode;"><span style="font-family:Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;font-size:small;"><span style="font-size:8.5pt;font-family:IndyCode;"><strong>tmp_table_size </strong></span><span style="font-size:8.5pt;font-family:&amp;"><strong>Global</strong><br />
<span style="font-family:Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;font-size:small;"><span style="font-size:8.5pt;font-family:&amp;">Both this and the </span><span style="font-size:8.5pt;font-family:IndyCode;">max_heap_table_size </span><span style="font-size:8.5pt;font-family:&amp;">setting are used to determine the maximum size allowed of an in-memory temporary table before it is converted to a MyISAM table. The smallest value <span style="line-height:12px;">for these two settings is the one utilized.</span></span></span></span></span></span></p>
<p class="MsoNormal" style="margin-bottom:.0001pt;line-height:normal;text-align:center;"><strong><span style="color:#0000ff;">MOCA (MYSQL Optimal Configuration Architechture)</span></strong></p>
<pre><span style="font-size:8.5pt;font-family:IndyCode;"><span style="font-family:Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;font-size:small;"><span style="font-size:8.5pt;font-family:&amp;"><span style="font-family:Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;font-size:small;"><span style="font-size:8.5pt;font-family:&amp;"><span style="line-height:12px;">1)  /opt/Mysql/5.1.33           -------------- Software Installed at this Location
2) db01/mysql/mysql01/data --------  Data Directory
<span style="color:#000000;line-height:19px;white-space:normal;font-size:13px;">Db01/mysql/mysql01/binlogs    ------------- binary logs directory
Db01/mysql/mysql01/admin       ------------ main administration</span></span></span></span></span></span></span></pre>
<p>&nbsp;</p>
<p></span></span></h2>
<p>Db01/mysql/mysql01/Backups   &#8212;&#8212;&#8212;&#8212;  Backups<br />
Db01/mysql/mysql01/Trans        &#8212;&#8212;&#8212;&#8212;  Transaction Data Files<br />
Db01/mysql/mysql01/TransLogs  &#8212;&#8212;&#8212;-   Trans Log Files.</p>
<h1 style="text-align:center;"><strong><span style="text-decoration:underline;"><span style="color:#000080;">Backup Strategies and Backup Procedures.<br />
</span></span></strong></h1>
<p><strong>Logical Backup: </strong>Taking Backup Online While Database is Running.</p>
<p><strong>Physical Backup: </strong> Taking Backup of Database Files or Disk Partitions: Occupies More Space.</p>
<p><strong>Full Backup: </strong> Taking Full Backup of Database.</p>
<p><strong>Incremental Backup: </strong> Taking Backups of the Database Since the last Backup.  You may take first full Backup and take Incremental Backups to Save Time. Once a Week full backup might be necessary.</p>
<p><strong>Consistent Backup:</strong> Taking Backup at an Exact Moment of Time, A Backup Process may take time to Complete<br />
<strong>HOT Backup:</strong> Taking Backup while Database is Running.<br />
<strong>Cold Backup:</strong> Taking Backup While Database is Offline.<br />
<strong>Point-in-Time-Restore:</strong> Restoring Backup for Certain Time and Date.</p>
<h1><strong><span style="text-decoration:underline;"><span style="color:#4b2e9d;">REPLICATION &#8211; - Configuring Slave Backup Server.</span></span></strong></h1>
<p>Restore Database and Execute a <strong>CHANGE MASTER </strong>Command to configure the Slave.<br />
<strong><br />
LOAD DATA FROM Master</strong> – Master to Slave.<br />
<strong>Grant Replication Slave on *.* to ‘Slave’ @ ‘Slave-host’ Identified by ‘Password’ ;</strong></p>
<p><strong> </strong></p>
<p><strong>2) Edit My.cnf   Configuration file and add the below line</strong></p>
<p><strong>[mysqld]<br />
Server-Id  =  1<br />
Log – bin = Slave_log</strong></p>
<p><strong> </strong></p>
<p><strong>Show Master Status;</strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong></p>
<p class="MsoNormal" style="text-align:center;"><strong><span style="text-decoration:underline;"><span style="color:red;">PARTITIONING TABLES</span></span></strong></p>
<p class="MsoListParagraphCxSpFirst" style="text-indent:-.25in;"><span style="color:red;">1)<span style="font:7pt &amp;"> </span></span><span style="color:red;">Horizontal Partitioning : Partition tables horizontally as if 2 tables (table1 and table2) both are separated by a line. I) Archiving Old Data is a Common task in Horizontal Partitioning. Merge tables will be used to Partition Data Horizontally.</span></p>
<p class="MsoListParagraphCxSpLast" style="text-indent:-.25in;"><span style="color:red;">2)<span style="font:7pt &amp;"> </span></span><span style="color:red;">Vertical Partitioning: Partitioning table vertically using de-Normalization: A Customer Table will be devided into a two tables splitting customer Data Columns.</span></p>
<p class="MsoNormal" style="margin-left:.25in;"><span style="color:red;"> </span></p>
<p class="MsoNormal" style="margin-left:.25in;"><span style="color:red;"> </span></p>
<p class="MsoNormal" style="margin-left:.25in;text-align:center;"><strong><span style="text-decoration:underline;"><span style="color:red;">Partition Algorithm in MYSQL</span></span></strong></p>
<p class="MsoListParagraphCxSpFirst" style="text-indent:-.25in;"><span style="color:red;">1)<span style="font:7pt &amp;"> </span></span><span style="color:red;">Range: Selects a Partition by Determining if the partition key is inside a Range of Values. An Example of Partition for all Rows based on Customer in Values less than 500,000 Can go into one partition and values greater than or Equal to go into another Partition.</span></p>
<p class="MsoListParagraphCxSpMiddle"><span style="color:red;">Ex:</span></p>
<p class="MsoListParagraphCxSpMiddle"><span style="color:red;"> Create TABLE INVOICES (ID,CLASS,DEPT) </span></p>
<p class="MsoListParagraphCxSpLast"><span style="color:red;">Partition by Range (To_Days (Entry_Date),</span></p>
<p></strong></p>
<p>&nbsp;</p>
<p><strong><span style="font-size:11pt;font-family:&amp;">Partition PO Values Less than (To_Days (‘2009-01-01)),<br />
Partition PO Values Less than (To_Days (‘2009-02-01)),<br />
Partition PO Values Less than (To_Days (‘2009-03-01)),<br />
Partition PO Values Less than (To_Days (‘2009-04-01)),<br />
Partition PO Values Less than (To_Days (‘2009-05-01)),<br />
Partition PO Values Less than MAXVALUE.</span></strong></p>
<p><strong><span style="font-size:11pt;font-family:&amp;"> </span></strong></p>
<p><strong></p>
<p class="MsoListParagraph" style="text-align:center;"><strong><span style="text-decoration:underline;"><span style="color:#17365d;"><span style="color:#800080;">SHOW PLUGINS (all are active except ndbcluster);</span><span style="color:#800080;"> </span></span></span></strong></p>
<p><strong> </strong><strong> </strong><span style="color:#800080;"> </span></p>
<p></strong></p>
<p><strong><span style="font-size:11pt;"><span style="color:#800080;">B</span></span><span style="font-size:11pt;font-family:&amp;">inlog<br />
Partition<br />
CSV<br />
MEMORY<br />
InnoDB<br />
MyISAM<br />
MRG_MYISAM<br />
ndbcluster &#8211; DISABLED &#8211; needs to be downloaded and Installed in order to work.<br />
</span></strong></p>
<h1 style="text-align:center;"><strong><span style="text-decoration:underline;"><span style="color:#800000;">INNODB Row Level Locking</span></span></strong></h1>
<p><strong><span style="font-size:11pt;font-family:&amp;"><span style="font-family:verdana, arial, helvetica, sans-serif;font-weight:normal;line-height:23px;font-size:small;color:#202020;"></p>
<p style="font-size:14px;line-height:25px;font-family:sans-serif;display:block;max-width:720px;margin:0 0 10px;padding:0;">Advantages of row-level locking:</p>
<div class="itemizedlist" style="font-size:14px;">
<ul style="list-style-image:url('http://dev.mysql.com/common/img/list-orange-disc.png');list-style-type:initial;list-style-position:initial;margin:0 4px 8px 16px;padding:0;">
<li style="margin-bottom:5px;margin-left:8px;font-size:14px;line-height:14px;list-style-position:outside;list-style-image:none;list-style-type:disc;vertical-align:middle;">
<p style="font-size:14px;line-height:25px;font-family:sans-serif;display:block;max-width:720px;margin:0 0 10px;padding:0;">Fewer lock conflicts when different sessions access different rows</p>
</li>
<li style="margin-bottom:5px;margin-left:8px;font-size:14px;line-height:14px;list-style-position:outside;list-style-image:none;list-style-type:disc;vertical-align:middle;">
<p style="font-size:14px;line-height:25px;font-family:sans-serif;display:block;max-width:720px;margin:0 0 10px;padding:0;">Fewer changes for rollbacks</p>
</li>
<li style="margin-bottom:5px;margin-left:8px;font-size:14px;line-height:14px;list-style-position:outside;list-style-image:none;list-style-type:disc;vertical-align:middle;">
<p style="font-size:14px;line-height:25px;font-family:sans-serif;display:block;max-width:720px;margin:0 0 10px;padding:0;">Possible to lock a single row for a long time</p>
</li>
</ul>
</div>
<p style="font-size:14px;line-height:25px;font-family:sans-serif;display:block;max-width:720px;margin:0 0 10px;padding:0;">Disadvantages of row-level locking:</p>
<div class="itemizedlist" style="font-size:14px;">
<ul style="list-style-image:url('http://dev.mysql.com/common/img/list-orange-disc.png');list-style-type:initial;list-style-position:initial;margin:0 4px 8px 16px;padding:0;">
<li style="margin-bottom:5px;margin-left:8px;font-size:14px;line-height:14px;list-style-position:outside;list-style-image:none;list-style-type:disc;vertical-align:middle;">
<p style="font-size:14px;line-height:25px;font-family:sans-serif;display:block;max-width:720px;margin:0 0 10px;padding:0;">Requires more memory than page-level or table-level locks</p>
</li>
<li style="margin-bottom:5px;margin-left:8px;font-size:14px;line-height:14px;list-style-position:outside;list-style-image:none;list-style-type:disc;vertical-align:middle;">
<p style="font-size:14px;line-height:25px;font-family:sans-serif;display:block;max-width:720px;margin:0 0 10px;padding:0;">Slower than page-level or table-level locks when used on a large part of the table because you must acquire many more locks</p>
</li>
<li style="margin-bottom:5px;margin-left:8px;font-size:14px;line-height:14px;list-style-position:outside;list-style-image:none;list-style-type:disc;vertical-align:middle;">
<p style="font-size:14px;line-height:25px;font-family:sans-serif;display:block;max-width:720px;margin:0 0 10px;padding:0;">Slower than other locks if you often do <code class="literal" style="color:#026789;font-size:13px;background-color:white;font-weight:bold;font-family:monospace, fixed;">GROUP BY</code> operations on a large part of the data or if you must scan the entire table frequently</p>
</li>
</ul>
</div>
<p></span></span></strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/grabameat.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/grabameat.wordpress.com/129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/grabameat.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/grabameat.wordpress.com/129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/grabameat.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/grabameat.wordpress.com/129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/grabameat.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/grabameat.wordpress.com/129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/grabameat.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/grabameat.wordpress.com/129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/grabameat.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/grabameat.wordpress.com/129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/grabameat.wordpress.com/129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/grabameat.wordpress.com/129/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grabameat.wordpress.com&amp;blog=8513308&amp;post=129&amp;subd=grabameat&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://grabameat.wordpress.com/2009/11/06/ramblings-on-mysql-administration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3f6ce70b3776ab061ca481c7ec80919c?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">grabameat</media:title>
		</media:content>
	</item>
		<item>
		<title>Restore SVN from Backup</title>
		<link>http://grabameat.wordpress.com/2009/10/06/restore-svn-from-backup/</link>
		<comments>http://grabameat.wordpress.com/2009/10/06/restore-svn-from-backup/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 00:05:21 +0000</pubDate>
		<dc:creator>grabameat</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[cron job]]></category>
		<category><![CDATA[crontab]]></category>
		<category><![CDATA[svn restore]]></category>

		<guid isPermaLink="false">http://grabameat.wordpress.com/?p=122</guid>
		<description><![CDATA[First of all , Create the Repository (don&#8217;t import any of your working copies or anything.. just the clean repository). to Create a Repository issue the below command. svnadmin create &#8211;fs-type fsfs /srv/svn/repos if your Svn Backup is saved in .tgz format i.e., backup.tgz then unzip it first using the command tar -xvzf filename.gz for [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grabameat.wordpress.com&amp;blog=8513308&amp;post=122&amp;subd=grabameat&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>First of all ,</p>
<p><strong>Create the Repository (don&#8217;t import any of your working copies or anything.. just the clean repository).</strong></p>
<p>to Create a Repository issue the below command.</p>
<p><strong>svnadmin create &#8211;fs-type fsfs /srv/svn/repos</strong></p>
<p>if your Svn Backup is saved in  .tgz format i.e., backup.tgz then unzip it first using the command</p>
<p><strong>tar -xvzf filename.gz</strong></p>
<p><strong>for ex: tar -xvzf 030001.tgz</strong> will unzip the file in your given location with a dumpfile as saved previously by the command script.</p>
<p>then run the below script to restore the Repository from Backup.</p>
<p><strong>svnadmin load       &lt; </strong></p>
<p>ex: #svnadmin load /srv/svn/repos &lt; /home/sree/Desktop/030001/dumpfile.txt</p>
<p>then the dumping process will start and dump all the revisions inside the Selected Folder.</p>
<p>check your repository before updating or committing any of your new files.</p>
<p>here are some of the external bash commands if you need for your directory removal  with some content in it.</p>
<p><strong>ex:  rm -rf repos  (will delete main folder and sub folders inside)</strong></p>
<p>if you have any issues please leave a comment.</p>
<h1><span style="color:#ff6600;"><strong>to set the Cron Job for SVN use the below commands</strong></span></h1>
<p><span style="color:#333399;">#crontab -l will list out all the cron jobs</span></p>
<p><span style="color:#333399;">#crontab -e    will edit the cron job file in VI Editor.</span></p>
<p><strong><span style="color:#008000;">&#8220;MAILTO=chava.sree@gmail.com&#8221;<br />
0 3 * * * /srv/svn/backup/inc_backup.sh</span></strong></p>
<p><span style="color:#333399;"><span style="color:#333399;">w</span>ill do incremental backups everyday.</span></p>
<p><span style="color:#333399;">this is the Reference URL  http://www.cyberciti.biz/faq/how-do-i-add-jobs-to-cron-under-linux-or-unix-oses/</span></p>
<p>Thanks<br />
Sree.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/grabameat.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/grabameat.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/grabameat.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/grabameat.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/grabameat.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/grabameat.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/grabameat.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/grabameat.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/grabameat.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/grabameat.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/grabameat.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/grabameat.wordpress.com/122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/grabameat.wordpress.com/122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/grabameat.wordpress.com/122/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grabameat.wordpress.com&amp;blog=8513308&amp;post=122&amp;subd=grabameat&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://grabameat.wordpress.com/2009/10/06/restore-svn-from-backup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3f6ce70b3776ab061ca481c7ec80919c?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">grabameat</media:title>
		</media:content>
	</item>
		<item>
		<title>Apache Server lock issue</title>
		<link>http://grabameat.wordpress.com/2009/09/24/apache-server-lock-issue/</link>
		<comments>http://grabameat.wordpress.com/2009/09/24/apache-server-lock-issue/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 20:36:39 +0000</pubDate>
		<dc:creator>grabameat</dc:creator>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[apache webserver]]></category>

		<guid isPermaLink="false">http://grabameat.wordpress.com/?p=119</guid>
		<description><![CDATA[Os: Fedora Linux Webserver : Apache ver 2.1.2 Issue: Figured out Apache Server is not running when i run the command &#8220;service httpd status&#8221; until then i am running http://localhost/ in the browser which is working fine and unable to run any other programs and when i used this command &#8220;# service httpd status: i [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grabameat.wordpress.com&amp;blog=8513308&amp;post=119&amp;subd=grabameat&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Os: Fedora Linux<br />
Webserver : Apache ver 2.1.2</p>
<p>Issue:<br />
Figured out Apache Server is not running when i run the command &#8220;service httpd status&#8221;  until then i am running http://localhost/ in the browser which is working fine and unable to run any other programs </p>
<p>and when i used this command &#8220;# service httpd status: i got the below message </p>
<p>[root@hirodexdbserver ~]# service httpd status<br />
httpd dead but subsys locked</p>
<p>i thought it might be some locks issue and restarted the server </p>
<p>#service httpd restart     &#8211; i got the below error again.<br />
**********************<br />
[root@hirodexdbserver ~]# service httpd restart<br />
Stopping httpd:                                            [FAILED]<br />
Starting httpd: (98)Address already in use: make_sock: could not bind to address [::]:80<br />
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80<br />
no listening sockets available, shutting down<br />
Unable to open logs<br />
                                                           [FAILED]<br />
You have mail in /var/spool/mail/root<br />
[root@hirodexdbserver ~]# service httpd restart<br />
**********************</p>
<p><strong>Steps to Resolve the Issue<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</strong><br />
after figuring out and looking at my httpd.conf file and make sure the pid file is pointing to the right file</p>
<p><strong>PidFile run/httpd.pid</strong></p>
<p>and change the path here to<br />
go to <strong>/etc/rc.d/init.d/httpd</strong>  open this file<br />
and find the below line.</p>
<p><font color="red">pidfile=${PIDFILE-/var/run/httpd/httpd.pid}</font></p>
<p>to:<br />
<font color="blue">pidfile=${PIDFILE-/var/run/httpd.pid}</font></p>
<p>Restart the Apache Server </p>
<p># service httpd restart<br />
Stopping httpd:                                            [  OK  ]<br />
Starting httpd:                                            [  OK  ]</p>
<p>which should give you the above status.</p>
<p>hope this helps.</p>
<p>Thanks</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/grabameat.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/grabameat.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/grabameat.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/grabameat.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/grabameat.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/grabameat.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/grabameat.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/grabameat.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/grabameat.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/grabameat.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/grabameat.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/grabameat.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/grabameat.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/grabameat.wordpress.com/119/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grabameat.wordpress.com&amp;blog=8513308&amp;post=119&amp;subd=grabameat&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://grabameat.wordpress.com/2009/09/24/apache-server-lock-issue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3f6ce70b3776ab061ca481c7ec80919c?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">grabameat</media:title>
		</media:content>
	</item>
		<item>
		<title>SVN Backup Commands</title>
		<link>http://grabameat.wordpress.com/2009/09/16/svn-backup-commands/</link>
		<comments>http://grabameat.wordpress.com/2009/09/16/svn-backup-commands/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 01:02:02 +0000</pubDate>
		<dc:creator>grabameat</dc:creator>
				<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn backup]]></category>

		<guid isPermaLink="false">http://grabameat.wordpress.com/?p=116</guid>
		<description><![CDATA[#!/bin/bash echo “+++ Backing up subversion repositories” NOW=`date +&#8221;%OH%M%S&#8221;` cd backup mkdir -p $NOW svnadmin dump /srv/svn/repos &#62; $NOW/dumpfile.txt tar cfpz $NOW.tgz $NOW . rm -rf $NOW echo “+++ Svn Backup Successfully Completed. Thank you” http://bash.cyberciti.biz/backup/copy-all-local-files-to-remote-ftp-server-2/<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grabameat.wordpress.com&amp;blog=8513308&amp;post=116&amp;subd=grabameat&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>#!/bin/bash</p>
<p>echo “+++ Backing up subversion repositories”<br />
NOW=`date +&#8221;%OH%M%S&#8221;`<br />
cd backup<br />
mkdir -p $NOW<br />
svnadmin dump /srv/svn/repos &gt; $NOW/dumpfile.txt<br />
tar cfpz $NOW.tgz $NOW .<br />
rm -rf $NOW<br />
echo “+++ Svn Backup Successfully Completed. Thank you”</p>
<p>http://bash.cyberciti.biz/backup/copy-all-local-files-to-remote-ftp-server-2/</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/grabameat.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/grabameat.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/grabameat.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/grabameat.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/grabameat.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/grabameat.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/grabameat.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/grabameat.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/grabameat.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/grabameat.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/grabameat.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/grabameat.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/grabameat.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/grabameat.wordpress.com/116/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grabameat.wordpress.com&amp;blog=8513308&amp;post=116&amp;subd=grabameat&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://grabameat.wordpress.com/2009/09/16/svn-backup-commands/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3f6ce70b3776ab061ca481c7ec80919c?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">grabameat</media:title>
		</media:content>
	</item>
		<item>
		<title>Subversion Backup &amp; Restore Automation</title>
		<link>http://grabameat.wordpress.com/2009/09/15/subversion-backup-automation/</link>
		<comments>http://grabameat.wordpress.com/2009/09/15/subversion-backup-automation/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 20:49:31 +0000</pubDate>
		<dc:creator>grabameat</dc:creator>
				<category><![CDATA[subversion]]></category>

		<guid isPermaLink="false">http://grabameat.wordpress.com/?p=111</guid>
		<description><![CDATA[http://www.hacking-gurus.net/2009/04/26/subversion-backup-and-restore/<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grabameat.wordpress.com&amp;blog=8513308&amp;post=111&amp;subd=grabameat&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>BACKUP</strong></p>
<p># Subversion Repositories backup script</p>
<p># Please start configuring here<br />
svnbasedir=&#8221;/srv/svn&#8221;<br />
svnfullbkdir=&#8221;/srv/svn/backups/full&#8221; #Don&#8217;t put a trailing slash!<br />
logfile=&#8221;/srv/svn/backups/log.txt&#8221;<br />
tmpdir=&#8221;/tmp&#8221;</p>
<p># dont change below</p>
<p>#check if log file exists<br />
touch ${logfile}<br />
#redirect stdout and stderr to the logfile<br />
mkdir -p $(dirname ${logfile})<br />
exec &gt;&gt; ${logfile}<br />
exec 2&gt;&amp;1</p>
<p>echo &#8220;+++ Backing up subversion repositories&#8221;<br />
#Looks for dirs containing a file &#8220;format&#8221;, that&#8217;s not in the /db/ directory.<br />
#This seems to match the root of a SVN repo. YMMV<br />
repos=$(find $svnbasedir -name format  -a \! -path &#8216;*/db/*&#8217;  -printf &#8216;%h\n&#8217;)</p>
<p>#Make sure that our backup location exists<br />
mkdir -p ${svnfullbkdir}</p>
<p>for repo in $repos ; do<br />
	subpath=$(echo ${repo} | sed -e &#8220;s#${svnbasedir}/##&#8221;)<br />
	name=$(basename $subpath)<br />
	subpath=$(dirname $subpath)<br />
	echo &#8221;   $repo&#8221;<br />
	lastrev=$(svnlook youngest ${repo})</p>
<p>	mkdir -p ${svnfullbkdir}/${subpath}<br />
	svnadmin dump -q ${repo} &gt; ${svnfullbkdir}/${name}.dump<br />
	echo  &#8220;Dumping ${repo} to  ${name}.dump  \n&#8221; </p>
<p>done</p>
<p><strong>RESTORE</strong></p>
<p>#!/bin/sh<br />
# Subversion Repositories backup script</p>
<p># Please start configuring here</p>
<p>svnbasedir=&#8221;/svn/svn&#8221;<br />
svnfullbkdir=&#8221;/tmp/svn-dump&#8221; #Don&#8217;t put a trailing slash!<br />
svnincbkdir=&#8221;/subversion/backup/incremental&#8221;<br />
logfile=&#8221;/subversion/backup/log.txt&#8221;<br />
tmpdir=&#8221;/tmp&#8221;</p>
<p># dont change below</p>
<p>touch ${logfile}<br />
#redirect stdout and stderr to the logfile<br />
mkdir -p $(dirname ${logfile})<br />
exec &gt;&gt; ${logfile}<br />
exec 2&gt;&amp;1</p>
<p>echo &#8220;+++ Restoring subversion repositories &#8220;<br />
#Looks for subversion backup dumps taken before<br />
repos=$(find $svnfullbkdir -name &#8216;*.dump&#8217; )</p>
<p>mkdir -p ${svnbasedir}</p>
<p>for repo in $repos ; do</p>
<p>	dirname=${repo%.dump}<br />
	name=$(basename $dirname)<br />
	$curpath = &#8220;/svn/svn/&#8221;.${name}<br />
	echo &#8221; creating reposity ${name} at ${curpath} &#8220;<br />
	svnadmin create /svn/svn/${name}</p>
<p>	echo &#8221; loading ${repo} &#8220;<br />
	svnadmin load -q /svn/svn/${name} &lt; ${repo}</p>
<p>done</p>
<p>***** ANOTHER WAY OF BACKUP ***********</p>
<p>http://www.linuxquestions.org/questions/linux-server-73/svn-server-backup-574111/</p>
<p>incremental backup.. </p>
<p># svnadmin dump &#8211;incremental /srv/svn/repos | gzip -c &gt; /srv/svn/dumped.gz</p>
<p>Actual Code</p>
<p>#!/bin/bash</p>
<p>NOW=`perl -e &#8216;print time;&#8217;`<br />
cd /var/backup/svn<br />
mkdir $NOW<br />
svnadmin dump /opt/repositories.svn/CC &gt; $NOW/dumpfile.txt<br />
tar cfpz $NOW.tgz $NOW<br />
rm -rf $NOW</p>
<p>&#8230;then follow that up with another cronjob that does this:</p>
<p><strong>CRON JOB</strong></p>
<p>45 3 * * * for i in `find /var/backup -type f -mtime +2` ; do rm -f $i ; done</p>
<p>The first cronjob does a full dump of the svn database and then zips it. (We are paranoid, we only do full dumps of databases and database-like applications.) Later on after that&#8217;s complete, the nightly backup process runs and the full dump is taken as part of a daily backup to tape. The second cronjob deletes anything it finds in the /var/backup tree that&#8217;s older than two days. That way I know I have two days of backups on disk, and I can restore the full database from any day I have tape for.</p>
<p>How to Add a script to Cron Job.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/grabameat.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/grabameat.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/grabameat.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/grabameat.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/grabameat.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/grabameat.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/grabameat.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/grabameat.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/grabameat.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/grabameat.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/grabameat.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/grabameat.wordpress.com/111/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/grabameat.wordpress.com/111/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/grabameat.wordpress.com/111/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grabameat.wordpress.com&amp;blog=8513308&amp;post=111&amp;subd=grabameat&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://grabameat.wordpress.com/2009/09/15/subversion-backup-automation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3f6ce70b3776ab061ca481c7ec80919c?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">grabameat</media:title>
		</media:content>
	</item>
		<item>
		<title>Code of Conduct for DBA&#8217;s</title>
		<link>http://grabameat.wordpress.com/2009/09/08/code-of-conduct-for-dbas/</link>
		<comments>http://grabameat.wordpress.com/2009/09/08/code-of-conduct-for-dbas/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 02:54:20 +0000</pubDate>
		<dc:creator>grabameat</dc:creator>
				<category><![CDATA[Database Administration]]></category>

		<guid isPermaLink="false">http://grabameat.wordpress.com/?p=104</guid>
		<description><![CDATA[http://www.simple-talk.com/sql/database-administration/a-code-of-conduct-for-dbas/?utm_source=simpletalk&#38;utm_medium=email&#38;utm_content=CodeOfConduct20090908&#38;utm_campaign=SQL<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grabameat.wordpress.com&amp;blog=8513308&amp;post=104&amp;subd=grabameat&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Despite the fact DBAs are protectors of an organization’s knowledge, and privy to much confidential information, there is no clearly defined set of rules and standards to help govern and guide their ethical conduct.  Brad McGehee, in an article based on a chapter from the second edition of his book <a style="text-decoration:none;color:#cc6633;" href="http://www.red-gate.com/products/SQL_Backup/offers/backup_how_to_become_exceptional_dba.htm?utm_source=simpletalk&amp;utm_medium=email&amp;utm_content=BradExceptionalDBA200909&amp;utm_campaign=sqlbackup">How to Become an Exceptional DBA</a>, discusses a Code of Conduct for DBAs. <span style="font-size:9pt;font-family:Arial, sans-serif;" lang="EN-GB">He advises on why such a code is required, the sort of topics it should contain, and how it might be enforced</span>. Much of this article has relevance for any IT professional.</p>
<p style="font-size:12px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">Physicians, attorneys, accountants, engineers, realtors, and many other professionals have written guidelines designed to discourage misconduct and illegal activity, and to promote the ethical conduct of its members. In fact, according to the Sarbanes-Oxley act, all public companies in the United States are required to create and follow their own code of conduct.</p>
<p style="font-size:17px;margin-left:10px;font-family:Arial, Helvetica, sans-serif;text-align:left;border-right-width:medium;border-right-style:none;border-right-color:initial;padding-right:0;border-top-color:silver;border-top-width:2px;border-top-style:solid;font-weight:bold;float:right;padding-bottom:15px;line-height:15px;margin-right:10px;padding-top:10px;border-bottom-color:silver;border-bottom-width:1px;border-bottom-style:solid;">if, as a DBA, you<br />
identify criminal<br />
behavior within<br />
your organization,<br />
what do you do?</p>
<p style="font-size:12px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">However, despite the fact that DBAs are essentially protectors of an organization&#8217;s knowledge, and privy to much confidential information, there are no clearly-defined set of rules, values, standards, and guidelines to help govern and guide their behavior.</p>
<p style="font-size:12px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">In this article, I define what a code of conduct is, explain how it can be useful to DBAs and the organizations they work for, and consider if and how it could be enforced. Finally, I offer my take on a &#8220;Code of Conduct&#8221; for the Exceptional DBA. Rather than be prescriptive, my goal is simply to offer advice to DBAs on how they might conduct themselves within the bounds of the professional responsibilities of their job.</p>
<h1 style="font-size:19px;margin-left:0;font-family:'Times New Roman', Times, serif;">What is a Code of Conduct?</h1>
<p style="font-size:12px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">Generally speaking, a code of conduct is a set of formal, written rules, policies, standards, guidelines, obligations, behaviors, expectations, and principles that are voluntarily adhered to by a group of people with similar goals, values, and responsibilities. While other definitions exist, this one will serve our purpose well enough, as we seek to define the standards of conduct to which a DBA should adhere, while carrying out their professional duties.</p>
<div style="margin-left:28.35pt;margin-right:0;border-color:initial initial initial gray;border-style:none none none solid;border-width:medium medium medium 2.25pt;padding:0 0 0 6pt;">
<p style="font-size:12px;margin-left:0;font-family:Arial, Helvetica, sans-serif;text-align:left;border:1px solid silver;padding:10px;"><strong>NOTE: </strong>For different perspectives on this topic from other IT professionals, you can explore these websites that contain Codes of Ethics: <a style="text-decoration:none;color:#cc6633;" href="http://www.acm.org/about/code-of-ethics">The Association for Computing Machinery&#8217;s (ACM</a>), or the <a style="text-decoration:none;color:#cc6633;" href="http://www.aitp.org/organization/about/ethics/ethics.jsp">Association of Information Technology Professionals (AITP)</a></p>
</div>
<h1 style="font-size:19px;margin-left:0;font-family:'Times New Roman', Times, serif;">How Can a Code of Conduct be Useful to DBAs?</h1>
<p style="font-size:12px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">To many people, a &#8220;Code of Conduct&#8221; means one thing: more rules. Most DBAs, myself included, would consider themselves mature enough to make their own decisions and choices, and are naturally resistant to the idea of someone telling them what to do and how to do it.</p>
<p style="font-size:12px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">If this is the case, then why have I written this article? Well, first, my intent is not to offer a set of rules that have to be followed but, instead, a set of guidelines that can be useful for DBAs who want to fully understand and appreciate the nature and scope of their duties and responsibilities. In other words, it is intended to be educational.</p>
<p style="font-size:17px;margin-left:10px;font-family:Arial, Helvetica, sans-serif;text-align:left;border-right-width:medium;border-right-style:none;border-right-color:initial;padding-right:0;border-top-color:silver;border-top-width:2px;border-top-style:solid;font-weight:bold;float:right;padding-bottom:15px;line-height:15px;margin-right:10px;padding-top:10px;border-bottom-color:silver;border-bottom-width:1px;border-bottom-style:solid;">It&#8217;s a sad fact that<br />
many organizations<br />
don&#8217;t fully understand<br />
and appreciate the<br />
true role of a DBA.</p>
<p style="font-size:12px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">At a fundamental level, most DBAs believe they understand what it means to behave &#8220;ethically&#8221;. In my experience, instances of willful negligence, or blatantly unethical behavior, are relatively scarce in our profession. However, there are many &#8220;grey&#8221; areas where a DBA, especially a less-experienced DBA, can find themselves unsure of where their responsibilities end, and how exactly they should respond to a potentially compromising situation.</p>
<p style="font-size:12px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">For example if, as a DBA, you identify criminal behavior within your organization, what do you do? Hopefully, your answer would be that you&#8217;d report it. However, is that the end of your responsibilities? What if the company you work for does not respond appropriately? What further action should you take, if any?</p>
<p style="font-size:12px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">It&#8217;s a sad fact that many organizations don&#8217;t fully understand and appreciate the true role of a DBA. In their attempts to save money, they sometimes cut corners that can directly affect the integrity of their data, and so unwittingly place the guardians of their data in a difficult dilemma. If you find yourself in this situation then, hopefully, this code of conduct may help convince your organization of the importance of the role of the DBA, and the need to employ experienced DBAs to safeguard their business data. For example, if you are having difficulty convincing your manager to adhere to government regulation that affects the data you manage, then referring the manager to this Code of Conduct might be useful.</p>
<p style="font-size:12px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">Perhaps above all else, the &#8220;Exceptional DBA&#8217;s Code of Conduct&#8221; can be a source of pride to all of us who choose to adhere to it, and give us more confidence that we are doing the best we can at our jobs.</p>
<h1 style="font-size:19px;margin-left:0;font-family:'Times New Roman', Times, serif;">How Should a Code of Conduct be Implemented and Enforced?</h1>
<p style="font-size:12px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">Whenever the topic of a &#8220;code of conduct&#8221; is discussed, one of the first questions to be asked is: how can it be enforced? After all, if the code is not enforced in any way then, it is argued, who is it benefiting? There is no straightforward answer to the question of how to enforce such a code, or even if it should be enforced, rather than be voluntary.</p>
<p style="font-size:12px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">One suggestion is that the code be enforced by an independent, professional organization, such as the ACM, AITP, or PASS. Anyone who fails to follow the established code of conduct could have their membership of the organization revoked. On the assumption that most businesses would regard membership of the organization a key requirement in their hiring process, then it could, in theory, prove an effective deterrent to malpractice.</p>
<p style="font-size:17px;margin-left:10px;font-family:Arial, Helvetica, sans-serif;text-align:left;border-right-width:medium;border-right-style:none;border-right-color:initial;padding-right:0;border-top-color:silver;border-top-width:2px;border-top-style:solid;font-weight:bold;float:right;padding-bottom:15px;line-height:15px;margin-right:10px;padding-top:10px;border-bottom-color:silver;border-bottom-width:1px;border-bottom-style:solid;">Again, any DBA who fails<br />
to follow the established<br />
code could have their<br />
certification rescinded.</p>
<p style="font-size:12px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">Another suggestion is that organizations that offer DBA certifications, such as Microsoft, should enforce some code of conduct. Again, any DBA who fails to follow the established code could have their certification rescinded. Obviously, this would only be an effective measure for organizations that require certification as part of their terms of employment. On the other hand, if Microsoft were to attempt this, what about the Oracle and MySQL DBAs? Would they need a separate code that is tied to their certifications?</p>
<p style="font-size:12px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">Another option is to have a DBA Code of Conduct enforced on a per-organization basis. After all, many organizations already require their employers to abide by a &#8220;code of conduct,&#8221; often in the form of an employee handbook. Such a code could be expanded to incorporate conduct specific to DBAs. On the other hand, if a company creates a separate code of conduct for DBAs, wouldn&#8217;t it also have to create different codes of conducts for other job titles? Again, this is not a great solution.</p>
<p style="font-size:12px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">In light of the numerous complications of implementing and enforcing a DBA&#8217;s Code of Conduct, I suggest that following such a code, or not, is a personal choice on behalf of the individual DBA. As I noted earlier, I regard such as code as being primarily educational in nature, with the rewards for following it being a successful, rewarding, long-term, and satisfying career as a DBA. For those who choose not to follow it, well, who knows how their career will turn out? They might get lucky and survive over the long haul, but I doubt if they will ever fall into the Exceptional DBA category.</p>
<h1 style="font-size:19px;margin-left:0;font-family:'Times New Roman', Times, serif;">The Exceptional DBA&#8217;s Code of Conduct</h1>
<p style="font-size:12px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">This section contains my suggestions for the core items that should comprise &#8220;The Exceptional DBA&#8217;s Code of Conduct&#8221;. My focus is on providing general guidelines that will help any DBA become more successful in their career.</p>
<p style="font-size:12px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">I won&#8217;t be so presumptuous as to imply that these guidelines are ideal or exhaustive, but they should hopefully get you thinking and be useful as a guide to you in your role as a DBA.</p>
<h2 style="font-size:17px;margin-left:20px;font-family:'Times New Roman', Times, serif;">Protection and Disclosure of Data</h2>
<ol>
<li style="margin-top:0;font-size:12px;margin-bottom:3px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">DBAs shall never intentionally do anything that contributes to the corruption or loss of an organization&#8217;s data. While this should be a no-brainer, I am including the obvious, just to cover all the bases.</li>
<li style="margin-top:0;font-size:12px;margin-bottom:3px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">Above all else, the DBA is the guardian, or protector, of an organization&#8217;s data. The responsibilities of the DBA in this regard include but are not limited to:
<ul style="margin-top:0;">
<li style="margin-top:0;font-size:12px;margin-bottom:3px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">Preventing data corruption (from applications, hardware, and people).</li>
<li style="margin-top:0;font-size:12px;margin-bottom:3px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">Provide high data availability, as defined by the organization&#8217;s policy. Develop, and regularly test, a disaster recovery plan to minimize unexpected downtime, as defined by the organization&#8217;s policy.</li>
</ul>
</li>
<li style="margin-top:0;font-size:12px;margin-bottom:3px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">DBAs shall take all reasonable precautions to ensure that changes to a production server have no detrimental consequences. All proposed changes should be thoroughly tested on a test server prior to deployment to production.</li>
<li style="margin-top:0;font-size:12px;margin-bottom:3px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">DBAs shall proactively take all the necessary steps to ensure that data can only be accessed by authorized users. This may include, but is not limited to: SQL Server security, Windows Authentication security, encryption, SQL injection attack prevention, auditing, or other such security policies, as defined by their organization.</li>
<li style="margin-top:0;font-size:12px;margin-bottom:3px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">DBAs generally have full access to all the data in a database. This presents two important points:
<ul style="margin-top:0;">
<li style="margin-top:0;font-size:12px;margin-bottom:3px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">DBAs shall only view data in a database if they need to access it to perform their job duties. For example, a DBA may need to access data to optimize a query or create a report. But if the DBA doesn&#8217;t need to access and view data for job-related tasks, then DBAs shall not snoop through the data for the sake of viewing it.</li>
<li style="margin-top:0;font-size:12px;margin-bottom:3px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">If, through the course of their required job duties, DBAs do view confidential data, DBAs shall not share any sensitive or confidential information with any unauthorized users.</li>
</ul>
</li>
<li style="margin-top:0;font-size:12px;margin-bottom:3px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">DBAs shall provide full cooperation with both inside and outside audits, providing truthful and factual information</li>
<li style="margin-top:0;font-size:12px;margin-bottom:3px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">If the DBA learns that contractors, co-workers, or managers are making poor choices that could negatively affect the integrity or security of the organization&#8217;s data, then the DBA should notify the appropriate persons within their organization.</li>
<li style="margin-top:0;font-size:12px;margin-bottom:3px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">If a DBA discovers misuse of an organization&#8217;s data, then the DBA should report this behavior to the appropriate persons within their organization.</li>
<li style="margin-top:0;font-size:12px;margin-bottom:3px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">The DBA should maintain proper and complete documentation for all servers and processes for which he or she is responsible. The documentation should be of a form and standard that will allow a qualified peer to undertake the task, in the DBA&#8217;s absence. The DBA should never protect (hide) information from their organization that would prevent another person from easily taking over his or her position, should the need arise.</li>
</ol>
<h2 style="font-size:17px;margin-left:20px;font-family:'Times New Roman', Times, serif;">DBAs and the Law</h2>
<ol>
<li style="margin-top:0;font-size:12px;margin-bottom:3px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">Often, the data under the care of a DBA is subject to laws and regulations of one or more governing bodies. The DBA shall become familiar with these laws and regulations, and adhere to them.</li>
<li style="margin-top:0;font-size:12px;margin-bottom:3px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">The DBA shall enforce all software licensing agreement with vendors, and notify the proper people in the organization if any breech is discovered.</li>
<li style="margin-top:0;font-size:12px;margin-bottom:3px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">If the DBA becomes aware of illegal activity within their organization, the DBA shall notify the proper people in their organization, or the appropriate law enforcement agency.</li>
</ol>
<h2 style="font-size:17px;margin-left:20px;font-family:'Times New Roman', Times, serif;">Dealing With Third-Parties</h2>
<ol>
<li style="margin-top:0;font-size:12px;margin-bottom:3px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">DBAs shall not accept gifts or favors from vendors if the purpose of the gift or favor is to influence, or to reward, the DBA&#8217;s choice of purchasing goods and services from the vendor. More specifically:</li>
</ol>
<ul style="margin-top:0;">
<li>
<ul style="margin-top:0;">
<li style="margin-top:0;font-size:12px;margin-bottom:3px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">The DBA shall proactively learn their organization&#8217;s policies about gifts, so they know what they can or cannot accept. For example, company policy might allow a vendor to take a DBA to dinner, or to receive a free gift at a conference or a user&#8217;s group meeting. On the other hand, an organization&#8217;s policy might limit the amount of the gift to a maximum value, such as $50.00.</li>
<li style="margin-top:0;font-size:12px;margin-bottom:3px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">The acceptance of a gift, even if allowed by the organization, should not influence the behavior of the DBA in regards to potential purchase of the vendor&#8217;s products and services.</li>
<li style="margin-top:0;font-size:12px;margin-bottom:3px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">Whenever a DBA purchases, or influences the purchase of goods or services, the DBA should only purchase those good or services because they are the ones that best meet the needs of the organization.</li>
</ul>
</li>
</ul>
<h2 style="font-size:17px;margin-left:20px;font-family:'Times New Roman', Times, serif;">General Conduct</h2>
<ol>
<li style="margin-top:0;font-size:12px;margin-bottom:3px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">The DBA shall conduct himself, or herself, professionally in all relationships with the people they deal with on a daily basis, including managers, co-workers, vendors, and their &#8220;internal customers.&#8221; Favoritism and discrimination of any sort is to be avoided.</li>
<li style="margin-top:0;font-size:12px;margin-bottom:3px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">If a DBA makes a mistake, and all DBAs make a mistake at one time or another, the mistake should be fixed as soon as is practical, and the DBA should inform everyone who might be negatively affected by the mistake as soon as possible. In addition:
<ul style="margin-top:0;">
<li style="margin-top:0;font-size:12px;margin-bottom:3px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">Mistakes should never be covered up.</li>
<li style="margin-top:0;font-size:12px;margin-bottom:3px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">DBAs should take full responsibility for all their decisions.</li>
</ul>
</li>
<li style="margin-top:0;font-size:12px;margin-bottom:3px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">If a DBA has management responsibilities, the DBA should mentor those who need help accomplishing their objectives, and allow those with experience and enthusiasm to succeed and flourish within the environment he or she provides for them.</li>
<li style="margin-top:0;font-size:12px;margin-bottom:3px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">The DBA will do their job to the best of his or her ability, developing and implementing best practices as appropriate, to help ensure the smooth and successful operations of the organization&#8217;s databases.</li>
<li style="margin-top:0;font-size:12px;margin-bottom:3px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">IT technology changes quickly. It is the responsibility of the DBA to proactively keep up on all technical areas that directly affect his or her job.</li>
<li style="margin-top:0;font-size:12px;margin-bottom:3px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">If the DBA has agreed to a SLA (Service Level Agreement) for the servers under their care, then they will abide by those agreements. If they are not technically able to abide by the agreed upon SLA (for whatever reason), the DBA needs to contact the SLA owner and work out how to resolve the problem.</li>
<li style="margin-top:0;font-size:12px;margin-bottom:3px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">Occasionally, the DBA may find that there is no established policy with regard to a particular aspect of their duties. For example, perhaps an organization doesn&#8217;t have a policy that defines the desired level of uptime, or that defines who can access what data. In areas where policies should be established (to ensure the protection and integrity of the organization&#8217;s data), but are not established, the DBA shall proactively identify the areas of need, make recommendations, and present them to the organization&#8217;s management so they can make appropriate decisions.</li>
</ol>
<p style="font-size:12px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">It is impossible to provide advice to guide a DBA through every aspect of their duties and responsibilities as a DBA, and there are many &#8220;grey areas&#8221;. What does the DBA do when they notify the appropriate persons of an important issue that could negatively impact the organization&#8217;s data, and no action is taken to rectify the issue? Where do a DBA&#8217;s responsibilities end with regard to uncovering illegal activity within an organization? What does a DBA do when a cost-cutting measure means they feel they can&#8217;t fully adhere to their own code of conduct? These are all difficult question for any employee, not just a DBA.</p>
<p style="font-size:12px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">If you, as a DBA, feel &#8220;pressured&#8221; to do something you are uncomfortable doing, then the best advice I can give is to talk to people. In most cases, the first step is to tell your manager, co-worker, project manager, or whoever is causing the problem, that you feel uncomfortable with their request, action or inaction, and explain why. If they don&#8217;t want to listen, your next option is to escalate the issue to their manager. You may, or may not, receive management support for your case. If not, then you have to decide to &#8220;give in,&#8221; or to find another job.</p>
<p style="font-size:12px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">The key thing is that the DBA needs to keep cool and not take any rash action. Before making an important decision that could potentially hurt your career, talk over the issue with people you trust in order to get their feedback and input. Only take action once you have clearly and thoughtfully considered the consequences of your choices. This might mean keeping quiet and not making trouble, escalating the issue to higher levels of management, reporting a crime to an enforcement agency, or finding a new job.</p>
<h1 style="font-size:19px;margin-left:0;font-family:'Times New Roman', Times, serif;">Summary</h1>
<p style="font-size:12px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">My goal in suggesting an &#8220;Exceptional DBA&#8217;s Code of Conduct&#8221; is to provide advice and guidance for those DBAs wanting to learn more about what it takes to become an Exceptional DBA. Is the code complete or perfect? Of course not. Consider it a working, educational document; it is certainly not intended to be an absolute set of rules that every DBA must always follow.</p>
<p style="font-size:12px;margin-left:20px;font-family:Arial, Helvetica, sans-serif;text-align:justify;">My hope is that it serves as a useful guide to the DBAs looking to navigate the &#8220;grey areas&#8221; and as a foundation for all those entering the profession with ambitions to become Exceptional DBAs.</p>
<div style="text-align:justify;"><span style="font-size:small;"><br />
</span></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/grabameat.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/grabameat.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/grabameat.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/grabameat.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/grabameat.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/grabameat.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/grabameat.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/grabameat.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/grabameat.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/grabameat.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/grabameat.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/grabameat.wordpress.com/104/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/grabameat.wordpress.com/104/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/grabameat.wordpress.com/104/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grabameat.wordpress.com&amp;blog=8513308&amp;post=104&amp;subd=grabameat&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://grabameat.wordpress.com/2009/09/08/code-of-conduct-for-dbas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3f6ce70b3776ab061ca481c7ec80919c?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">grabameat</media:title>
		</media:content>
	</item>
		<item>
		<title>MySql Creating Function Error. (Workaround Solution)</title>
		<link>http://grabameat.wordpress.com/2009/08/14/mysql-creating-function-error-workaround-solution/</link>
		<comments>http://grabameat.wordpress.com/2009/08/14/mysql-creating-function-error-workaround-solution/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 23:27:27 +0000</pubDate>
		<dc:creator>grabameat</dc:creator>
				<category><![CDATA[MySql]]></category>
		<category><![CDATA[mysql function error]]></category>

		<guid isPermaLink="false">http://grabameat.wordpress.com/?p=99</guid>
		<description><![CDATA[When I am trying to Create a Function in MySql Query Browser, I had the below error and want to get rid of it.. and found a solution, as ERROR 1418 (HY000) at line 253: This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grabameat.wordpress.com&amp;blog=8513308&amp;post=99&amp;subd=grabameat&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>When I am trying to Create a Function in MySql Query Browser, I had the below error and want to get rid of it.. and found a solution, as</p>
<pre style="color:black;background-color:#f9f9f9;line-height:1.1em;border:1px dashed #2f6fab;padding:1em;">  ERROR 1418 (HY000) at line 253: This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration
               and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)</pre>
<p>for the above error just set the below parameters in my.ini (for windows) and my.cnf (in linux) files to edit and add the below text.</p>
<p>in windows to edit the my.ini file go here c:/program files/mysql/mysql version5.4/bin/my.ini</p>
<p>in linux to edit the my.cnf file go here /etc/mysql/bin/my.cnf and add the below line to your config file.</p>
<pre style="color:black;background-color:#f9f9f9;line-height:1.1em;border:1px dashed #2f6fab;padding:1em;"> log_bin_trust_function_creators=1</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/grabameat.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/grabameat.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/grabameat.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/grabameat.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/grabameat.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/grabameat.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/grabameat.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/grabameat.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/grabameat.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/grabameat.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/grabameat.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/grabameat.wordpress.com/99/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/grabameat.wordpress.com/99/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/grabameat.wordpress.com/99/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grabameat.wordpress.com&amp;blog=8513308&amp;post=99&amp;subd=grabameat&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://grabameat.wordpress.com/2009/08/14/mysql-creating-function-error-workaround-solution/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3f6ce70b3776ab061ca481c7ec80919c?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">grabameat</media:title>
		</media:content>
	</item>
		<item>
		<title>Subversion Setup</title>
		<link>http://grabameat.wordpress.com/2009/07/29/subversion-setup/</link>
		<comments>http://grabameat.wordpress.com/2009/07/29/subversion-setup/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 00:59:30 +0000</pubDate>
		<dc:creator>grabameat</dc:creator>
				<category><![CDATA[Database Administration]]></category>
		<category><![CDATA[apache configuration]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://grabameat.wordpress.com/?p=76</guid>
		<description><![CDATA[http://www.eukhost.com/forums/f15/how-install-subversion-svn-linux-server-vps-3737/ http://marcgrabanski.com/article/installing-subversion-on-apache yum install subversion yum install mod_dav_svn Creating a User in Svn using the bash Command 1) htpasswd -cm users sam 2) htpasswd -cm users chava 3) htpasswd -cm users veera Importing a Folder to Repository in Svn (to checkout for later use) 1) svn import -m "Initial Import" local-directory-projectX http://server-name/svn/projectX 2) follow this [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grabameat.wordpress.com&amp;blog=8513308&amp;post=76&amp;subd=grabameat&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<pre>http://www.eukhost.com/forums/f15/how-install-subversion-svn-linux-server-vps-3737/

http://marcgrabanski.com/article/installing-subversion-on-apache
<ol>
<li>
<div>yum install subversion</div>
</li>
<li>
<div>yum install mod_dav_svn</div>
</li>
</ol>
</pre>
<p>Creating a User in Svn using the bash Command</p>
<p>1) htpasswd -cm users sam<br />
2) htpasswd -cm users chava<br />
3) htpasswd -cm users veera</p>
<p>Importing a Folder to Repository in Svn (to checkout for later use)</p>
<p>1) <tt>svn import -m "Initial Import" <em>local-directory-projectX</em> http://server-name/svn/<em>projectX</em></tt></p>
<p><em>2) </em></p>
<p>follow this link to install subversion Server 1.4 on Linux Server with Apache WebServer Running</p>
<p>http://www.yolinux.com/TUTORIALS/LinuxSubversionAndTracServer.html</p>
<p>Create a Subversion repository using the FSFS database format: (as root)</p>
<ul>
<li><tt>mkdir /srv/svn/repos</tt></li>
<li><tt>svnadmin create --fs-type fsfs /srv/svn/repos</tt></li>
<li><tt>chown apache:apache -R  /srv/svn/repos</tt><br />
(The Apache web server running as user &#8220;apache&#8221; is the process owner          which will be interfacing with the Subversion repository.)</li>
<li>SELinux security attribute assignment: (Red Hat EL4+, Fedora 3+)<br />
<tt>restorecon -R /srv/svn/repos</tt></li>
</ul>
<p>Apache configuration file: <tt>/etc/httpd/conf.d/subversion.conf</tt></p>
<ul>
<li>This example performs no authentication:<br />
<table border="1" cellspacing="1" cellpadding="4" width="100%" bgcolor="#000000">
<tbody>
<tr bgcolor="#c0c0c0">
<td>
<pre>LoadModule dav_svn_module     modules/mod_dav_svn.so       <em><strong>- Required for Apache interface</strong></em>
LoadModule authz_svn_module   modules/mod_authz_svn.so     <em><strong>- Required for "per-directory" access control</strong></em>
&lt;Location /svn&gt;        <strong>- URL path in web browser after "http://domain.com/"</strong>
   DAV svn
   SVNPath /srv/svn/repos        <strong>- Local path on server filesystem</strong>
&lt;/Location&gt;</pre>
</td>
</tr>
</tbody>
</table>
</li>
<li>This example authenticates to a local Apache user password file: User logins and passwords have no connection to user accounts.<br />
<table border="1" cellspacing="1" cellpadding="4" width="100%" bgcolor="#000000">
<tbody>
<tr bgcolor="#c0c0c0">
<td>
<pre>LoadModule dav_svn_module     modules/mod_dav_svn.so
LoadModule authz_svn_module   modules/mod_authz_svn.so
&lt;Location /svn&gt;
   DAV svn
   SVNPath /srv/svn/repos
   AuthType Basic
   AuthName "Subversion Repository"
   AuthUserFile /etc/httpd/conf/userpw
   require valid-user
&lt;/Location&gt;</pre>
</td>
</tr>
</tbody>
</table>
<p>Remove the line &#8220;require valid-user&#8221; to allow read-only access for unauthenticated users.</li>
</ul>
<p><strong><big>Importing Directory of Files Into Subversion:</big></strong></p>
<p>Subversion Repository on Server File system:</p>
<ul>
<li><tt>/srv/svn/repos</tt></li>
</ul>
<p>Import directory of files into Subversion:</p>
<ul>
<li>Local directory to import into Subversion:
<ul>
<li><tt><em>projectX</em>/trunk/...source code goes here...</tt></li>
<li><tt><em>projectX</em>/branches</tt></li>
<li><tt><em>projectX</em>/tags</tt></li>
</ul>
</li>
<li><tt>svn import -m "Initial Import" <em>local-directory-projectX</em> http://server-name/svn/<em>projectX</em></tt><br />
The import will create the new subdirectory branch &#8220;<em>projectX</em>&#8221; in the repository.</li>
</ul>
<p>Alternate directory creation method: (repository exists but the directories need to be generated)</p>
<ul>
<li><tt>svn mkdir -m"Initial creation of trunk directory" http://svn-server/svn/projectX/trunk</tt></li>
<li><tt>svn mkdir -m"Initial creation of branches directory" http://svn-server/svn/projectX/branches</tt></li>
<li><tt>svn mkdir -m"Initial creation of tags directory" http://svn-server/svn/projectX/tags</tt></li>
</ul>
<p>Browser view of a typical repository directory schema:</p>
<ul>
<li><tt>http://<em>svn-server</em>/svn/<em>projectX</em>/trunk</tt>: For the &#8220;HEAD&#8221;</li>
<li><tt>http://<em>svn-server</em>/svn/<em>projectX</em>/branches</tt>: For branches or &#8220;forks&#8221; in the code.</li>
<li><tt>http://<em>svn-server</em>/svn/<em>projectX</em>/tags</tt>: For tags identifying snapshots of milestones or significant releases.</li>
</ul>
<hr /><strong>Explanation of Subversion directories:</strong></p>
<ul>
<li><tt>/trunk</tt> : Contains the current development branch. New projects should be started here.</li>
<li><tt>/branches</tt> : A branch is just a special copy of the source tree within Subversion that started with a specific revision of the code.       A branch is created by using &#8220;svn copy&#8221; of the trunk to a branch i.e. <tt>/branch/name_of_branch_1.0</tt>.</li>
<li><tt>/branches/personal</tt> : Personal branches are for doing some work which you don&#8217;t want to have interfere with the main trunk until it is working or better defined.</li>
<li><tt>/tags</tt> : This is a ethod of bookmarking or taking a &#8220;snapshot&#8221; of some work in progress.</li>
<li><tt>/releases</tt> : This is similar to &#8220;tags&#8221; except that this version of the code makes it to production. Names used here should match product release names. i.e. version_1.1</li>
</ul>
<p><a name="NOCONTROLM"></a></p>
<hr />
<h4>Avoiding false diffs due to &#8220;^M&#8221; in a cross platform environment:</h4>
<p>The Microsoft development tools love to add a &#8220;^M&#8221; at the end of the line of every file they edit. This breaks UNIX shell script and causes many file difference tools to show a difference in a line of code. This can be avoided in a cross platform environment by telling Subversion that certain files (or all files) that no &#8220;^M&#8221;&#8216;s should be appended at the end of a line. The trigger in fact removes the &#8220;^M&#8221; when the file is checked in. It can also be removed using the command <tt>dos2unix</tt>.</p>
<p>Import files to support no &#8220;^M&#8221; carriage returns at the end of lines:<br />
(This sets file properties and creates a check-in trigger.)</p>
<ul>
<li>Remove &#8220;^M&#8221; from files: <tt>find <em>local-directory</em> -name "*.cpp" -exec dos2unix {} \;</tt></li>
<li>Upload directory of files into Subversion:<br />
<tt>svn import -m "Initial Import" <em>local-directory</em> http://<em>server-name</em>/svn/<em>projectX</em></tt></li>
<li>Checkout files from repository: <tt>svn co http://server-name/svn/<em>projectX</em>/trunk</tt><br />
This creates your local working directory under Subversion control.</li>
<li>Set file properties such that &#8220;^M&#8221; are removed during check-in if added:<br />
<tt>find ./ -name "*.cpp" -exec svn propset svn:eol-style LF {} \;</tt></li>
<li>Apply property changes to repository: <tt>svn ci -m "Apply LF properties" <em>local-directory</em></tt></li>
</ul>
<p>Note that the &#8220;propset&#8221; command must be used for new files added to the Subversion repository if they are to have these properties.</p>
<p>Users can also set this option in the file: <tt>$HOME/.subversion/config</tt></p>
<pre>..
...

[auto-props]
README = svn:eol-style=native
INSTALL = svn:eol-style=native
*.c = svn:eol-style=LF
*.cpp = svn:eol-style=LF
*.h = svn:eol-style=LF
*.dsp = svn:eol-style=CRLF
*.dsw = svn:eol-style=CRLF
*.sh = svn:eol-style=native;svn:executable
*.txt = svn:eol-style=LF
*.png = svn:mime-type=image/png
*.jpg = svn:mime-type=image/jpeg
Makefile = svn:eol-style=LF
*.html = svn:eol-style=LF
*.css = svn:eol-style=LF
*.java = svn:eol-style=LF
*.xml = svn:eol-style=LF
*.m4 = svn:eol-style=LF
*.pdf = svn:mime-type=application/pdf

...
..
<h4>Data repository dump:</h4>
<ul>
<li>Dump first entry to current:
 <tt>svnadmin dump /srv/svn/repos --revision 0:HEAD &gt; repos.dump</tt></li>
<li>Dump revision 625 to current:
 <tt>svnadmin dump /srv/svn/repos --revision 625:HEAD --incremental &gt; repos-625.dump</tt></li>

*************************************************************************************************************
</ul>

TROUBLESHOOTING SUBVERSION.
---------------------------

use the below path 

run the below commands first to make sure you are giving access to the repos folder.

use these vi commands to edit the file.

vi filename.

examples: http://www.cs.colostate.edu/helpdocs/vi.html

chown apache:apache -R /srv/svn/repos

restorecon -R /srv/svn/repos

edit this file and add the below script.

/etc/httpd/conf.d/svnserve.conf

enable these statements below

anon-access = read
auth-access = write

&lt;Location /svn&gt;
 DAV svn
 SVNPath /srv/svn/repos
 AuthType Basic
 AuthName "Subversion Repository"
 AuthUserFile /srv/svn/access/users
 require valid-user
&lt;/Location&gt;
<ul>
</ul>
</pre>
<p><em><br />
</em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/grabameat.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/grabameat.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/grabameat.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/grabameat.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/grabameat.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/grabameat.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/grabameat.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/grabameat.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/grabameat.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/grabameat.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/grabameat.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/grabameat.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/grabameat.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/grabameat.wordpress.com/76/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=grabameat.wordpress.com&amp;blog=8513308&amp;post=76&amp;subd=grabameat&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://grabameat.wordpress.com/2009/07/29/subversion-setup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/3f6ce70b3776ab061ca481c7ec80919c?s=96&#38;d=&#38;r=G" medium="image">
			<media:title type="html">grabameat</media:title>
		</media:content>
	</item>
	</channel>
</rss>
