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

<channel>
	<title>jon zobrist (dot) com &#187; MySQL Server Support</title>
	<atom:link href="http://www.jonzobrist.com/category/linux/mysql-server-support/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jonzobrist.com</link>
	<description>Unix, Linux, IT, Cloud, Meat</description>
	<lastBuildDate>Fri, 06 Jan 2012 18:59:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Script to rotate the MySQL General Query Log</title>
		<link>http://www.jonzobrist.com/2011/10/24/script-to-rotate-the-mysql-general-query-log/</link>
		<comments>http://www.jonzobrist.com/2011/10/24/script-to-rotate-the-mysql-general-query-log/#comments</comments>
		<pubDate>Tue, 25 Oct 2011 06:31:23 +0000</pubDate>
		<dc:creator>Jon Zobrist</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL Server Support]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[Debug]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[General Query Log]]></category>
		<category><![CDATA[Logrotate]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[MySQL Troubleshooting]]></category>
		<category><![CDATA[Rotate]]></category>
		<category><![CDATA[Troubleshooting]]></category>

		<guid isPermaLink="false">http://jonzobrist.com/?p=213</guid>
		<description><![CDATA[
Related posts:<ol>
<li><a href='http://www.jonzobrist.com/2011/06/15/i-am-always-cautious-with-this-on-my-clipboard/' rel='bookmark' title='I am always cautious with this on my clipboard..'>I am always cautious with this on my clipboard..</a> <small>...</small></li>
<li><a href='http://www.jonzobrist.com/2011/03/19/s3-du-sh-script-to-get-bucket-size-on-amazon-aws-s3/' rel='bookmark' title='S3-du.sh script to get bucket size on Amazon AWS S3'>S3-du.sh script to get bucket size on Amazon AWS S3</a> <small>...</small></li>
<li><a href='http://www.jonzobrist.com/2011/05/04/my-ec2-ebs-raid-0-creation-script/' rel='bookmark' title='My EC2 EBS RAID-0 creation script'>My EC2 EBS RAID-0 creation script</a> <small>...</small></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2011%2F10%2F24%2Fscript-to-rotate-the-mysql-general-query-log%2F' data-shr_title='Script+to+rotate+the+MySQL+General+Query+Log'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2011%2F10%2F24%2Fscript-to-rotate-the-mysql-general-query-log%2F' data-shr_title='Script+to+rotate+the+MySQL+General+Query+Log'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p>You want general query logging in, but don&#8217;t want to keep those pesky query log files around?</p>
<p>I generally setup the MySQL user and run this from cron.</p>
<p>Here&#8217;s my script to do so, <a title="Rotate General Log Bash Script Gzipped" href="http://www.jonzobrist.com/files/rotate-general-log.sh.gz">here&#8217;s a gzip&#8217;d version</a>, and here is a <a title="Rotate General Log Bash Script Zipped Version" href="http://www.jonzobrist.com/files/rotate-general-log.sh.zip">zipped version</a></p>
<p>&nbsp;</p>
<pre>#!/bin/bash
#setup a user in mysql with the RELOAD priviledge
#grant RELOAD on *.* to reloader@'localhost' identified by 'PASSWORD';
#flush privileges;

user="reloader"
password="PASSWORD"
LOG="${HOME}/mysqld/mysqld.log"
LOGARCHIVE="${HOME}/logarchive"
NEW_LOG="${LOGARCHIVE}/mysqld-`date +%F-%s`.log"
KEEP_MIN=15
MAX_LOAD="5.0"
RUNFILE="${HOME}/rotate-general-log.pid"

if [ -f ${RUNFILE} ]
 then
  echo "Runfile ${RUNFILE} exists, exiting at `date`"
  ${HOME}/bin/page.sh "Runfile ${RUNFILE} exists, exiting at `date`"
  exit 1
 else
  echo "$$" &gt; ${RUNFILE}
fi

#if [ $(echo "`cut -f1 -d ' ' /proc/loadavg` &lt; ${MAX_LOAD}" | bc) -eq 1 ];
if [ $(echo "`cut -f1 -d ' ' /proc/loadavg` &lt; ${MAX_LOAD}" | bc) -eq 1 ];
 then
  echo "System load less than ${MAX_LOAD}, proceeding [DEBUG]"
else
  echo "log rotate delayed, due to system load &gt; ${MAX_LOAD}"
  ${HOME}/bin/page.sh "log rotate delayed, due to system load &gt; ${MAX_LOAD}"
  /bin/rm ${RUNFILE}
  exit 1
fi

MYSQLD_PID=`pgrep mysqld`

if [ ! "${MYSQLD_PID}" ]
 then
  echo "Mysqld is NOT running, paging and exiting at `date`"
  ${HOME}/bin/page.sh "NO MySQLD on `hostname` at `date`"
  /bin/rm ${RUNFILE}
  exit 1
else
  echo "Mysqld running at `date`, PID ${MYSQLD_PID}, continuing"
fi

if [ -d "${LOGARCHIVE}" ]
 then
  echo "Moving general log at `date`"
  /bin/mv ${LOG} ${NEW_LOG}
  touch ${LOG}
  chmod og-rwx ${LOG}
  echo "Flushing general log at `date`"
  mysqladmin -u ${user} -p --password="${password}" flush-logs
  echo "Done flushing general log at `date`"
  echo "Gzipping ${NEW_LOG} log at `date`"
  gzip ${NEW_LOG}
  echo "Done gzipping ${NEW_LOG} log at `date`"
  echo "Size is `du -sh ${LOGARCHIVE}` pre-clean"
  echo "Cleaning ${LOGARCHIVE}, deleting files older than ${KEEP_MIN} minutes at `date`"
  find ${LOGARCHIVE} -iname "*.gz" -mmin +${KEEP_MIN} -print -exec /bin/rm {} \;
  echo "Done cleaning ${LOGARCHIVE}, at `date`"
  echo "Size is `du -sh ${LOGARCHIVE}` post-clean"
else
 echo "Missing logarchive dir ${LOGARCHIVE}"
  ${HOME}/bin/page.sh "Missing logarchive dir ${LOGARCHIVE}"
 /bin/rm ${RUNFILE}
 exit 1
fi

/bin/rm ${RUNFILE}
echo "Done at `date`"</pre>
<div class="shr-publisher-213"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2011%2F10%2F24%2Fscript-to-rotate-the-mysql-general-query-log%2F' data-shr_title='Script+to+rotate+the+MySQL+General+Query+Log'></a><a class='shareaholic-fbsend' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2011%2F10%2F24%2Fscript-to-rotate-the-mysql-general-query-log%2F'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2011%2F10%2F24%2Fscript-to-rotate-the-mysql-general-query-log%2F' data-shr_title='Script+to+rotate+the+MySQL+General+Query+Log'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom Automatic --><p>Related posts:<ol>
<li><a href='http://www.jonzobrist.com/2011/06/15/i-am-always-cautious-with-this-on-my-clipboard/' rel='bookmark' title='I am always cautious with this on my clipboard..'>I am always cautious with this on my clipboard..</a> <small>su mysql cd rm -Rf data/* innodb/* tmp/* logs/* mysqld/*...</small></li>
<li><a href='http://www.jonzobrist.com/2011/03/19/s3-du-sh-script-to-get-bucket-size-on-amazon-aws-s3/' rel='bookmark' title='S3-du.sh script to get bucket size on Amazon AWS S3'>S3-du.sh script to get bucket size on Amazon AWS S3</a> <small>Here is my script s3-du.sh that I wrote to determine...</small></li>
<li><a href='http://www.jonzobrist.com/2011/05/04/my-ec2-ebs-raid-0-creation-script/' rel='bookmark' title='My EC2 EBS RAID-0 creation script'>My EC2 EBS RAID-0 creation script</a> <small>I want to write up a full howto/tutorial, but have...</small></li>
</ol></p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.jonzobrist.com/2011/10/24/script-to-rotate-the-mysql-general-query-log/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I am always cautious with this on my clipboard..</title>
		<link>http://www.jonzobrist.com/2011/06/15/i-am-always-cautious-with-this-on-my-clipboard/</link>
		<comments>http://www.jonzobrist.com/2011/06/15/i-am-always-cautious-with-this-on-my-clipboard/#comments</comments>
		<pubDate>Wed, 15 Jun 2011 23:14:51 +0000</pubDate>
		<dc:creator>Jon Zobrist</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL Server Support]]></category>
		<category><![CDATA[msyql]]></category>
		<category><![CDATA[nuke]]></category>

		<guid isPermaLink="false">http://jonzobrist.com/?p=315</guid>
		<description><![CDATA[su mysql cd rm -Rf data/* innodb/* tmp/* logs/* mysqld/* mysql_install_db &#8211;defaults-file=${HOME}/etc/my.cnf ${HOME}/libexec/mysqld &#8211;defaults-file=${HOME}/etc/my.cnf &#62; ${HOME}/logs/init.log 2&#62;&#38;1 &#38; mysql_tzinfo_to_sql /usr/share/zoneinfo &#124; mysql -u root mysql &#160; &#160; &#160; &#160; &#160; No related posts. Related posts brought to you by Yet Another Related Posts Plugin.
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2011%2F06%2F15%2Fi-am-always-cautious-with-this-on-my-clipboard%2F' data-shr_title='I+am+always+cautious+with+this+on+my+clipboard..'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2011%2F06%2F15%2Fi-am-always-cautious-with-this-on-my-clipboard%2F' data-shr_title='I+am+always+cautious+with+this+on+my+clipboard..'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p>su mysql</p>
<p>cd</p>
<p>rm -Rf data/* innodb/* tmp/* logs/* mysqld/*</p>
<p>mysql_install_db &#8211;defaults-file=${HOME}/etc/my.cnf</p>
<p>${HOME}/libexec/mysqld &#8211;defaults-file=${HOME}/etc/my.cnf &gt; ${HOME}/logs/init.log 2&gt;&amp;1 &amp;</p>
<p>mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<div class="shr-publisher-315"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2011%2F06%2F15%2Fi-am-always-cautious-with-this-on-my-clipboard%2F' data-shr_title='I+am+always+cautious+with+this+on+my+clipboard..'></a><a class='shareaholic-fbsend' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2011%2F06%2F15%2Fi-am-always-cautious-with-this-on-my-clipboard%2F'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2011%2F06%2F15%2Fi-am-always-cautious-with-this-on-my-clipboard%2F' data-shr_title='I+am+always+cautious+with+this+on+my+clipboard..'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom Automatic --><p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.jonzobrist.com/2011/06/15/i-am-always-cautious-with-this-on-my-clipboard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LCOD – 4.12.10 – Quick Mysqlreport to e-mail setup</title>
		<link>http://www.jonzobrist.com/2010/04/12/lcod-%e2%80%93-4-12-10-%e2%80%93-quick-mysqlreport-to-e-mail-setup/</link>
		<comments>http://www.jonzobrist.com/2010/04/12/lcod-%e2%80%93-4-12-10-%e2%80%93-quick-mysqlreport-to-e-mail-setup/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 00:31:57 +0000</pubDate>
		<dc:creator>Jon Zobrist</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Linux Command of the Day]]></category>
		<category><![CDATA[MySQL Server Support]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://jonzobrist.com/?p=118</guid>
		<description><![CDATA[This will be a quick install to setup your server to e-mail you daily mysql reports using the cool mysqlreport application at hackmysql.com
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2010%2F04%2F12%2Flcod-%25e2%2580%2593-4-12-10-%25e2%2580%2593-quick-mysqlreport-to-e-mail-setup%2F' data-shr_title='LCOD+%E2%80%93+4.12.10+%E2%80%93+Quick+Mysqlreport+to+e-mail+setup'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2010%2F04%2F12%2Flcod-%25e2%2580%2593-4-12-10-%25e2%2580%2593-quick-mysqlreport-to-e-mail-setup%2F' data-shr_title='LCOD+%E2%80%93+4.12.10+%E2%80%93+Quick+Mysqlreport+to+e-mail+setup'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p>This will be a quick install to setup your server to e-mail you daily mysql reports using the cool mysqlreport application at <a title="MySQL Report" href="http://hackmysql.com/mysqlreport">hackmysql.com</a></p>
<p>As the user you want to set this up on, run the following commands.</p>
<p>(Note that I touch and then chmod og-rwx the .my.cnf file, since you&#8217;re putting your users mysql password in it, creating it and making it unreadable before editing is always a good idea.)</p>
<pre>wget http://hackmysql.com/scripts/mysqlreport
chmod uog+x mysqlreport
mkdir bin logs
mv mysqlreport bin/
touch ~/.my.cnf
chmod og-rwx ~/.my.cnf
vi ~/.my.cnf
</pre>
<p>Now, put in a client section like this in, you can find your sock file with grep sock /etc/my.cnf, or grep sock /etc/mysql/my.cnf</p>
<pre>[client]</pre>
<pre>user="root"</pre>
<pre>password="password"</pre>
<pre>socket=/var/run/mysqld/mysqld.sock</pre>
<p>Now, install perl&#8217;s DBD::MySQL</p>
<p>Debian/Ubuntu:</p>
<pre>sudo su</pre>
<pre>apt-get install libdbd-mysql-perl</pre>
<p>via CPAN/Other Linux/Generic BSD:</p>
<pre>perl -MCPAN -e shell</pre>
<p>Optional, update CPAN:</p>
<pre>install Bundle::CPAN</pre>
<pre>reload cpan</pre>
<p>(If there are errors on following some dependencies exit, and restart your CPAN shell, then start with install Bundle::CPAN)<br />
Install perl DBI</p>
<pre>install DBD::mysql
exit
</pre>
<p>Now, run it to test, you should see a bunch of text output</p>
<pre>~/bin/mysqlreport
</pre>
<p>Now, set it up to run from cron</p>
<pre>
crontab -e
</pre>
<p>Add a line like this (this will email to test@example.com a full report nightly at midnight, and put the last nights report in /home/USERNAME/logs/mysqlreport)</p>
<pre>
0 0 * * * /home/USERNAME/bin/mysqlreport --email test@example.com &gt; /home/USERNAME/logs/mysqlreport.log 2&gt;&amp;1
</pre>
<div class="shr-publisher-118"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2010%2F04%2F12%2Flcod-%25e2%2580%2593-4-12-10-%25e2%2580%2593-quick-mysqlreport-to-e-mail-setup%2F' data-shr_title='LCOD+%E2%80%93+4.12.10+%E2%80%93+Quick+Mysqlreport+to+e-mail+setup'></a><a class='shareaholic-fbsend' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2010%2F04%2F12%2Flcod-%25e2%2580%2593-4-12-10-%25e2%2580%2593-quick-mysqlreport-to-e-mail-setup%2F'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2010%2F04%2F12%2Flcod-%25e2%2580%2593-4-12-10-%25e2%2580%2593-quick-mysqlreport-to-e-mail-setup%2F' data-shr_title='LCOD+%E2%80%93+4.12.10+%E2%80%93+Quick+Mysqlreport+to+e-mail+setup'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom Automatic --><p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.jonzobrist.com/2010/04/12/lcod-%e2%80%93-4-12-10-%e2%80%93-quick-mysqlreport-to-e-mail-setup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LCOD &#8211; 5.9.07 &#8211; Find out what Perl DBI drivers are installed</title>
		<link>http://www.jonzobrist.com/2007/05/09/lcod-5-9-07-find-out-what-perl-dbi-drivers-are-installed/</link>
		<comments>http://www.jonzobrist.com/2007/05/09/lcod-5-9-07-find-out-what-perl-dbi-drivers-are-installed/#comments</comments>
		<pubDate>Thu, 10 May 2007 05:34:12 +0000</pubDate>
		<dc:creator>Jon Zobrist</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Linux Command of the Day]]></category>
		<category><![CDATA[MySQL Server Support]]></category>
		<category><![CDATA[DBI]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Perl]]></category>

		<guid isPermaLink="false">http://jonzobrist.com/?p=73</guid>
		<description><![CDATA[A perl one liner for you. Say you&#8217;re installing something that is DBI and it&#8217;s giving errors or having problems, or anything, and you want to know if it&#8217;s because you don&#8217;t have the correct perl DBI driver installed? This is a simple, one liner, which will tell you a list of all the perl [...]
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2007%2F05%2F09%2Flcod-5-9-07-find-out-what-perl-dbi-drivers-are-installed%2F' data-shr_title='LCOD+-+5.9.07+-+Find+out+what+Perl+DBI+drivers+are+installed+'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2007%2F05%2F09%2Flcod-5-9-07-find-out-what-perl-dbi-drivers-are-installed%2F' data-shr_title='LCOD+-+5.9.07+-+Find+out+what+Perl+DBI+drivers+are+installed+'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p> A perl one liner for you.</p>
<p>Say you&#8217;re installing something that is DBI and it&#8217;s giving errors or having problems,</p>
<p>or anything, and you want to know if it&#8217;s because you don&#8217;t have the correct perl DBI</p>
<p>driver installed? This is a simple, one liner, which will tell you a list of all the perl DBI drivers.</p>
<p>Run from the command line</p>
<p> perl -e &#8216;use DBI;@driver_names = DBI->available_drivers; print &#8220;@driver_names\n&#8221;;&#8217;</p>
<p>You should get output like</p>
<p> DBM ExampleP File Proxy SQLite2 Sponge mysql</p>
<p>enjoy </p>
<div class="shr-publisher-73"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2007%2F05%2F09%2Flcod-5-9-07-find-out-what-perl-dbi-drivers-are-installed%2F' data-shr_title='LCOD+-+5.9.07+-+Find+out+what+Perl+DBI+drivers+are+installed+'></a><a class='shareaholic-fbsend' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2007%2F05%2F09%2Flcod-5-9-07-find-out-what-perl-dbi-drivers-are-installed%2F'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2007%2F05%2F09%2Flcod-5-9-07-find-out-what-perl-dbi-drivers-are-installed%2F' data-shr_title='LCOD+-+5.9.07+-+Find+out+what+Perl+DBI+drivers+are+installed+'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom Automatic --><p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.jonzobrist.com/2007/05/09/lcod-5-9-07-find-out-what-perl-dbi-drivers-are-installed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL backup sript &#8211; more info</title>
		<link>http://www.jonzobrist.com/2007/04/02/mysql-backup-sript-more-info/</link>
		<comments>http://www.jonzobrist.com/2007/04/02/mysql-backup-sript-more-info/#comments</comments>
		<pubDate>Tue, 03 Apr 2007 05:22:06 +0000</pubDate>
		<dc:creator>Jon Zobrist</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL Server Support]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[backups]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://jonzobrist.com/?p=66</guid>
		<description><![CDATA[Here&#8217;s my script to backup mysqlTo install it on a linux/freebsd box just edit the top parts for configuration. If you make a user mysqldump with home directory of /home/mysqldump and a mysql password of p@assword, make a /home/mysqldump/logs and /home/mysqldump/bkup directories, this should just work. Hack it up, it&#8217;s GPL&#8217;d. Please email me updates [...]
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2007%2F04%2F02%2Fmysql-backup-sript-more-info%2F' data-shr_title='MySQL+backup+sript+-+more+info+'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2007%2F04%2F02%2Fmysql-backup-sript-more-info%2F' data-shr_title='MySQL+backup+sript+-+more+info+'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><div id="mainBody"><a href="http://www.submarinefund.com/backup_mysql/backup_mysql">Here&#8217;s</a> my script to backup mysqlTo install it on a linux/freebsd box just edit the top parts for configuration. If you make a user mysqldump with home directory of /home/mysqldump and a mysql password of p@assword, make a /home/mysqldump/logs and /home/mysqldump/bkup directories, this should just work. Hack it up, it&#8217;s GPL&#8217;d.</p>
<p>Please email me updates you make and I will post them here. My email is   <script type="text/javascript">// <![CDATA[
 var prefix = '&#109;a' + 'i&#108;' + '&#116;o';
 var path = 'hr' + 'ef' + '=';
 var addy16635 = 'kgb' + '&#64;';
 addy16635 = addy16635 + 'bl&#117;&#101;s&#117;n' + '&#46;' + 'n&#101;t';
 document.write( '<a ' + path + '\'' + prefix + ':' + addy16635 + '\'>' );
 document.write( addy16635 );
 document.write( '<\/a>' );
 //\n 
// --&gt;
// ]]&gt;</script><a href="mailto:kgb@bluesun.net">kgb@bluesun.net</a><script type="text/javascript">// <![CDATA[
 document.write( '<span style="\" mce_style="\"'display: none;\'>' );
// ]]&gt;</script><span style="display: none;">This e-mail address is being protected from spam bots, you need JavaScript enabled to view it  <script type="text/javascript">// <![CDATA[
 document.write( '</' );
 document.write( 'span>' );
// ]]&gt;</script></span></p>
<p align="left"><span> More &#8220;in depth&#8221; installation: </span></p>
<div><span>adduser mysqldump</span><br />
<span>passwd mysqldump</span><br />
<span>mysql -p</span><br />
<span>GRANT select,lock tables on *.* to mysqldump@localhost identified by &#8216;p@ssword&#8217;;</span><br />
<span>flush privileges;</span><br />
<span>su &#8211; mysqldump</span><br />
<span>mkdir ~/bin</span><br />
<span>mkdir ~/logs</span><br />
<span>mkdir ~/bkup</span><br />
<span>cd ~/bin</span><br />
<span>wget http://www.submarinefund.com/backup_mysql/backup_mysql</span><br />
<span>chmod u+x backup_mysql</span><br />
<span>vi backup_mysql</span><br />
<span>make changes to config</span><br />
<span> &#8211; change passwd to the same one you used on the </span><br />
<span> GRANT instead of p@ssword</span><br />
<span> &#8211; change num_days_keep to the number of days you want to keep around</span></p>
<p><span> &#8211; change all the commands to match your system, these </span><br />
<span> should be the same on most linux systems, BSD&#8217;s may </span><br />
<span> need to change some paths</span></div>
<p>test the script</p>
<p>add a line to your crontab like this<br />
0 3 * * *  /home/mysqldump/bin/backup_mysql &gt;&gt; /home/mysqldump/logs/cron.log 2&gt;&amp;1</p></div>
<p><a title="MySQL backup script" href="http://subfund.submarinefund.com/backup_mysql.gz" target="_blank">script gzipped</a></p>
<p><a href="http://subfund.submarinefund.com/backup_mysql" target="_blank">script txt</a></p>
<p><a href="http://subfund.submarinefund.com/backup_mysql.zip" target="_blank">script zip zipped</a></p>
<div class="shr-publisher-66"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2007%2F04%2F02%2Fmysql-backup-sript-more-info%2F' data-shr_title='MySQL+backup+sript+-+more+info+'></a><a class='shareaholic-fbsend' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2007%2F04%2F02%2Fmysql-backup-sript-more-info%2F'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2007%2F04%2F02%2Fmysql-backup-sript-more-info%2F' data-shr_title='MySQL+backup+sript+-+more+info+'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom Automatic --><p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.jonzobrist.com/2007/04/02/mysql-backup-sript-more-info/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL backup script</title>
		<link>http://www.jonzobrist.com/2007/04/01/mysql-backup-script/</link>
		<comments>http://www.jonzobrist.com/2007/04/01/mysql-backup-script/#comments</comments>
		<pubDate>Mon, 02 Apr 2007 05:20:54 +0000</pubDate>
		<dc:creator>Jon Zobrist</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL Server Support]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[backups]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">http://jonzobrist.com/?p=64</guid>
		<description><![CDATA[I wrote this script because I needed to have each table in all databases backed up separately. If you have hundreds or thousands of tables and and want to back them up separately then this script could help. It also names and rolls files by unix timestamp, and allows you to specify how long a [...]
No related posts.

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2007%2F04%2F01%2Fmysql-backup-script%2F' data-shr_title='MySQL+backup+script+'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2007%2F04%2F01%2Fmysql-backup-script%2F' data-shr_title='MySQL+backup+script+'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p>I wrote this script because I needed to have each table in all databases backed up separately.<br />
If you have hundreds or thousands of tables and and want to back them up separately then this script could help. It also names and rolls files by unix timestamp, and allows you to specify<br />
how long a file is kept, regardless of number of backups made. So, say you want 2 days of backups, and you make one every hour (48 total) it will auto roll them after 2 days, suppose then you manually run the script to create a backup before some important change or event, this will still keep that backup for 2 days.</p>
<p><a title="Backup MySQL script in Perl in 2004" href="http://www.jonzobrist.com/files/backup_mysql.gz" target="_blank">Here&#8217;s</a> my script to backup mysql</p>
<p>To install it on a linux/freebsd box just edit the top parts for configuration. If you make a user mysqldump with home directory of /home/mysqldump and a mysql password of p@assword, make a /home/mysqldump/logs and /home/mysqldump/bkup directories, this should just work. Hack it up, it&#8217;s GPL&#8217;d.</p>
<p>Please email me updates you make and I will post them here. If you have questions you can email me, or post them on my LCoD message board. My email is<script type="text/javascript">// <![CDATA[
// <![CDATA[
 var prefix = '&#109;a' + 'i&#108;' + '&#116;o';
 var path = 'hr' + 'ef' + '=';
 var addy63284 = 'kgb' + '&#64;';
 addy63284 = addy63284 + 'bl&#117;&#101;s&#117;n' + '&#46;' + 'n&#101;t';
 document.write( '<a ' + path + '\'' + prefix + ':' + addy63284 + '\'>' );
 document.write( addy63284 );
 document.write( '<\/a>' );
 //\n 
// --&gt;
// ]]&gt;</script><a href="mailto:kgb@bluesun.net">kgb@bluesun.net</a><script type="text/javascript">// <![CDATA[
// <![CDATA[
 document.write( '<span style="\" mce_style="\"'display: none;\'>' );
// ]]&gt;</script><span style="display: none;">This e-mail address is being protected from spam bots, you need JavaScript enabled to view it<script type="text/javascript">// <![CDATA[
// <![CDATA[
 document.write( '</' );
 document.write( 'span>' );
// ]]&gt;</script></span>, but I don&#8217;t really check it that much <img src='http://www.jonzobrist.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>More &#8220;in depth&#8221; installation:<br />
adduser mysqldump<br />
passwd mysqldump<br />
mysql -p<br />
GRANT select,lock tables on *.* to mysqldump@localhost identified by &#8216;p@ssword&#8217;;<br />
flush privileges;<br />
su &#8211; mysqldump<br />
mkdir ~/bin<br />
mkdir ~/logs<br />
mkdir ~/bkup<br />
cd ~/bin<br />
wget http://www.submarinefund.com/backup_mysql/backup_mysql<br />
chmod u+x backup_mysql<br />
vi backup_mysql<br />
make changes to config<br />
- change passwd to the same one you used on the<br />
GRANT instead of p@ssword<br />
- change num_days_keep to the number of days you want to keep around</p>
<p>- change all the commands to match your system, these<br />
should be the same on most linux systems, BSD&#8217;s may<br />
need to change some paths</p>
<p>test the script</p>
<p>add a line to your crontab like this<br />
0 3 * * * /home/mysqldump/bin/backup_mysql &gt;&gt; /home/mysqldump/logs/cron.log 2&gt;&amp;1</p>
<div class="shr-publisher-64"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:none;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2007%2F04%2F01%2Fmysql-backup-script%2F' data-shr_title='MySQL+backup+script+'></a><a class='shareaholic-fbsend' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2007%2F04%2F01%2Fmysql-backup-script%2F'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fwww.jonzobrist.com%2F2007%2F04%2F01%2Fmysql-backup-script%2F' data-shr_title='MySQL+backup+script+'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetBottom Automatic --><p>No related posts.</p>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.jonzobrist.com/2007/04/01/mysql-backup-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

