<?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>Sniptools &#187; Unix</title>
	<atom:link href="http://sniptools.com/unix/feed" rel="self" type="application/rss+xml" />
	<link>http://sniptools.com</link>
	<description>Design &#38; Technology Observations</description>
	<lastBuildDate>Mon, 10 Oct 2011 02:12:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Fix for Cpanel update that breaks mysqlhotcopy</title>
		<link>http://sniptools.com/hosting/fix-mysqlhotcopy-broken-by-cpanel-upgrade</link>
		<comments>http://sniptools.com/hosting/fix-mysqlhotcopy-broken-by-cpanel-upgrade#comments</comments>
		<pubDate>Mon, 02 Apr 2007 11:10:00 +0000</pubDate>
		<dc:creator>Shanx</dc:creator>
				<category><![CDATA[Hosting]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[cpanel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[Tips/Tricks]]></category>

		<guid isPermaLink="false">http://sniptools.com/cms/?p=135</guid>
		<description><![CDATA[fix mysqlhotcopy broken by cpanel upgrade
]]></description>
			<content:encoded><![CDATA[<p>The recent upgrades of Cpanel have been a pain because they've broken mysqlhotcopy. Not kosher. Fortunately fixing this is pretty straightforward by simply downgrading the DBD module of Perl, on which mysqlhotcopy relies.</p>
<p><span id="more-135"></span></p>
<h3>The recent upgrades of Cpanel have been a pain because they've broken <code>mysqlhotcopy</code>. Not kosher. Fortunately fixing this is pretty easy, by simply downgrading the DBD module of Perl, which <code>mysqlhotcopy</code> relies on.</h3>
<p>Usually the error is something like this:</p>
<div class="code">Invalid db.table name 'DBNAME.USERNAME`.`campaign' at /usr/bin/mysqlhotcopy line 854.</div>
<p>To solve this, simply downgrade the DBD to version 4.001. Create a script anywhere on your root folder as, say, <code>dbd-downgrade.sh</code>:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src
<span style="color: #c20cb9; font-weight: bold;">wget</span> <span style="color: #660033;">-O</span> dbd.tar.gz  <span style="color: #ff0000;">&quot;http://search.cpan.org/CPAN/authors/id/C/CA/CAPTTOFU/DBD-mysql-4.001.tar.gz&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">gzip</span> <span style="color: #660033;">-cd</span> dbd.tar.gz <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">tar</span> xf -
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> dbd.tar.gz
<span style="color: #7a0874; font-weight: bold;">cd</span> DBD-mysql-<span style="color: #000000;">4.001</span>
<span style="color: #c20cb9; font-weight: bold;">perl</span> Makefile.PL
<span style="color: #c20cb9; font-weight: bold;">make</span>
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></td></tr></table></div>

<p>Then of course <code>chmod</code> the file to executable (644) and run it:</p>
<div class="code">./dbd-downgrade.sh</div>
<p>Then try your <code>mysqlhotcopy</code> command again. It should work. The only thing to consider is that if your Cpanel is setup to upgrade automatically, it may rebuild DBD. You may need to downgrade the DBD again, until this thing is fixed!</p>
<p>If after this update, you see the error for RELOAD privileges, like this…</p>
<pre>DBD::mysql::db do failed: Access denied; you need the RELOAD privilege for this operation at /usr/bin/mysqlhotcopy line 472.</pre>
<p>…then simply login to mysql as "root" user through the root SSH terminal, and execute the following command:</p>
<pre class="bash" >mysql&gt;  grant all privileges on *.* to root@localhost;
mysql&gt;  flush privileges;</pre>
<p>Done. That should do it. Let me know if it doesn't.</p>
<h3>A more long term fix</h3>
<p>MySQL bug list has a <a href="http://bugs.mysql.com/bug.php?id=27303">couple of suggested fixes</a>. If you are comfortable with Perl, you can edit the code in <code>/usr/bin/mysqlhotcopy</code> and have it solved in a better way.</p>
]]></content:encoded>
			<wfw:commentRss>http://sniptools.com/hosting/fix-mysqlhotcopy-broken-by-cpanel-upgrade/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

