<?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>MySQL Preacher &#187; cache</title>
	<atom:link href="http://mysqlpreacher.com/wordpress/tag/cache/feed/" rel="self" type="application/rss+xml" />
	<link>http://mysqlpreacher.com/wordpress</link>
	<description>A MySQL blog, from a MySQL DBA</description>
	<lastBuildDate>Wed, 16 Jun 2010 13:13:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>MySQL &#8211; IP vs DNS</title>
		<link>http://mysqlpreacher.com/wordpress/2009/12/mysql-ip-vs-dns/</link>
		<comments>http://mysqlpreacher.com/wordpress/2009/12/mysql-ip-vs-dns/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 15:39:12 +0000</pubDate>
		<dc:creator>Darren Cassar</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[OS]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[grants]]></category>
		<category><![CDATA[hosts]]></category>
		<category><![CDATA[skip-name-resolve]]></category>

		<guid isPermaLink="false">http://mysqlpreacher.com/wordpress/?p=315</guid>
		<description><![CDATA[A MySQL is running happily on a machine situated in a land far far away. I grant access to a user@machine_aaaaaa (grant select on db.* to &#8216;user&#8217;@'machine_aaaaa&#8217; identified by &#8216;password&#8217;; flush privileges;), send an email to the user saying it should run fine and happily go off my way. Mistake!
It seems this user can&#8217;t connect [...]]]></description>
			<content:encoded><![CDATA[<p>A MySQL is running happily on a machine situated in a land far far away. I grant access to a user@machine_aaaaaa (grant select on db.* to &#8216;user&#8217;@'machine_aaaaa&#8217; identified by &#8216;password&#8217;; flush privileges;), send an email to the user saying it should run fine and happily go off my way. Mistake!</p>
<p>It seems this user can&#8217;t connect to the mysql gets access denied:<br />
Access denied for user &#8216;user&#8217;@'machine_bbbbb&#8217; (using password: YES)</p>
<p>Note that the machine the user is being seen from is totally different from the one I set up in the grant!! WHY?</p>
<p>run a reverse lookup on the ip of machine_aaaaa, turns out it shows machine_bbbbb. So I figure a big bad guy messed up /etc/hosts, I was right! `cat /etc/hosts` just to find an entry for machine_aaaaa blehh</p>
<p>Ok, solution is to remove the entry from /etc/hosts (after finding out it wasn&#8217;t even necessary and wasn&#8217;t even supposed to be there in the first place), restart nscd.</p>
<p>Retry<br />
AGAIN &#8211; Access denied for user &#8216;user&#8217;@'machine_bbbbb&#8217; (using password: YES)</p>
<p>What the &#8230;.</p>
<p>What&#8217;s wrong now? &#8212; yeah silly me forgot to `flush hosts` :) </p>
<p>Retry<br />
YOHOO I&#8217;m in!</p>
<p>I&#8217;ve seen quite a few blogs about disabling name resolve in mysql with skip-name-resolve and granting privileges using IPs &#8211; something which would also have avoided the above (but still not found the root of the problem):</p>
<p><a href="http://jeremy.zawodny.com/blog/archives/011421.html">http://jeremy.zawodny.com/blog/archives/011421.html</a><br />
<a href="http://www.mysqlperformanceblog.com/2008/05/31/dns-achilles-heel-mysql-installation/">http://www.mysqlperformanceblog.com/2008/05/31/dns-achilles-heel-mysql-installation/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://mysqlpreacher.com/wordpress/2009/12/mysql-ip-vs-dns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
