<?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>A Fool's Wisdom &#187; MySQL</title>
	<atom:link href="http://foolswisdom.com/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://foolswisdom.com</link>
	<description>A fool and his blog are soon parted.</description>
	<lastBuildDate>Mon, 12 Dec 2011 22:39:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Mac, WordPress: &#8220;Error establishing a database connection&#8221;</title>
		<link>http://foolswisdom.com/mac-wordpress-error-establishing-a-database-connection/</link>
		<comments>http://foolswisdom.com/mac-wordpress-error-establishing-a-database-connection/#comments</comments>
		<pubDate>Wed, 23 Jul 2008 17:20:58 +0000</pubDate>
		<dc:creator>Lloyd</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://foolswisdom.com/?p=1283</guid>
		<description><![CDATA[If you get &#8220;Error establishing a database connection&#8221; when trying to set up WordPress.org on your Mac, are sure that the database name (DB_NAME), username (DB_USER) and password (DB_PASSWORD) are correct, the solution is very likely that you need to &#8230; <a href="http://foolswisdom.com/mac-wordpress-error-establishing-a-database-connection/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you get &#8220;Error establishing a database connection&#8221; when trying to set up <a href="http://wordpress.org/">WordPress.org</a> on your Mac, are sure that the database name (DB_NAME), username (DB_USER) and password (DB_PASSWORD) are correct, the solution is very likely that you need to set <code>mysql.default_socket = /tmp/mysql.sock</code> in <code>/etc/php.ini</code>.</p>
<p><span id="more-1283"></span>I read on the WordPress Support forums &#8220;<a href="http://wordpress.org/support/topic/160658 ">Error establishing a database connection on OS X 10.5</a>&#8221; where jonokane had the novel solution of changing the database host (DB_HOST) to capital L, &#8216;Localhost&#8217;.</p>
<p>mrogers writes that &#8220;This is definitely a bug in WordPress 2.5, because every other web app I have running on this machine uses &#8220;localhost&#8221; and it connects to the MySQL server just fine.&#8221;</p>
<p>The problem can be isolated to the PHP function mysql_connect() and its error return value is being suppressed:</p>
<p><code>Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/mysql/mysql.sock'</code></p>
<p>There is quite a bit of misinformation about what the problem and solution out there. The Apple doc &#8220;<a href="http://docs.info.apple.com/article.html?artnum=302977">Mac OS X Server 10.4.4: Improvements to Apache/PHP/MySQL interaction</a>&#8221; from January 2006 gives clues as to the problem. On Server, a custom MySQL is included and the doc includes:</p>
<blockquote><p>If you have downloaded and installed MySQL yourself but are using the pre-installed version of PHP, note that your custom version of MySQL might be configured to use the old MySQL socket location, /tmp/mysql.sock. The version of PHP in this software update uses the newer location /var/mysql/mysql.sock by default.</p></blockquote>
<p>The problem with Apple using the &#8220;newer location&#8221; is that MySQL hasn&#8217;t had a major release since 2005 and so their packages don&#8217;t use the newer location, and there is no custom MySQL package for the rest of us. We have to download the regular MySQL 5 package from MySQL.com.</p>
<p>Jonokane&#8217;s novel solution likely works because instead of using a socket for the local connection, it attempts a TCP/IP connection, and &#8216;Localhost&#8217; resolves to &#8216;localhost&#8217;. That will only solve the problem for WordPress though, and you would have the same problem with other PHP applications.</p>
<p>The correct solution is to:</p>
<p><code>$sudo cp /etc/php.ini.default /etc/php.ini<br />
$sudo chmod +w /etc/php.ini</code></p>
<p>And in your favorite editor find the line that starts <code>mysql.default_socket</code> and update it to read</p>
<p><code>mysql.default_socket = /tmp/mysql.sock</code></p>
<p>Now restart Apache, and it should be golden.</p>
<p>You won&#8217;t encounter this problem if you are using the packages from <a href="http://www.macports.org/">Mac Ports</a> or <a href="http://www.mamp.info/">MAMP</a>, but those would be their own adventures.</p>
]]></content:encoded>
			<wfw:commentRss>http://foolswisdom.com/mac-wordpress-error-establishing-a-database-connection/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>Congratulations to the Drupal 6 team!</title>
		<link>http://foolswisdom.com/congratulations-to-the-drupal-6-team/</link>
		<comments>http://foolswisdom.com/congratulations-to-the-drupal-6-team/#comments</comments>
		<pubDate>Thu, 14 Feb 2008 21:24:03 +0000</pubDate>
		<dc:creator>Lloyd</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[CMS]]></category>
		<category><![CDATA[Dave Olson]]></category>
		<category><![CDATA[DaveO]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[Drupal 6.0]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Raincity Studio]]></category>

		<guid isPermaLink="false">http://foolswisdom.com/?p=750</guid>
		<description><![CDATA[Drupal 6.0 was released yesterday. DaveO of Raincity Studio writes, &#8220;I think these changes (while admittedly lacking in really exciting talking points for the non-geeks) reflect an increased focus on usability and offer ways to do more with less.&#8221; Congratulations &#8230; <a href="http://foolswisdom.com/congratulations-to-the-drupal-6-team/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://drupal.org/drupal-6.0">Drupal 6.0</a> was released yesterday. <a href="http://uncleweed.net/">DaveO</a> of <a href="http://www.raincitystudios.com/">Raincity Studio</a> <a href="http://www.raincitystudios.com/blogs-and-pods/daveo/drupal-6-content-management-system-released">writes</a>, &#8220;I think these changes (while admittedly lacking in really exciting talking points for the non-geeks) reflect an increased focus on usability and offer ways to do more with less.&#8221;</p>
<p>Congratulations to the Drupal community!</p>
]]></content:encoded>
			<wfw:commentRss>http://foolswisdom.com/congratulations-to-the-drupal-6-team/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

