<?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>Cory O&#039;Daniel - These are just words &#187; mysql</title>
	<atom:link href="http://coryodaniel.com/index.php/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://coryodaniel.com</link>
	<description>Software development, thoughts, and randomness</description>
	<lastBuildDate>Thu, 17 Nov 2011 21:18:05 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Installing MySQL on Mac OSX w/ Ports</title>
		<link>http://coryodaniel.com/index.php/2010/02/11/installing-mysql-on-mac-osx-w-ports/</link>
		<comments>http://coryodaniel.com/index.php/2010/02/11/installing-mysql-on-mac-osx-w-ports/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 19:08:31 +0000</pubDate>
		<dc:creator>Cory O'Daniel</dc:creator>
				<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[mac osx]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[ports]]></category>

		<guid isPermaLink="false">http://coryodaniel.com/?p=470</guid>
		<description><![CDATA[So, I originally installed MySQL on my new MacBook using the DMG as was alluded to in a previous post..
I rebooted my laptop the other day and for some reason all of my tables (InnoDB) where corrupted... I couldn't get them to repair. All the *.frm files were present. Even when I did a 'show [...]]]></description>
			<content:encoded><![CDATA[<p>So, I originally installed MySQL on my new MacBook using the DMG as was alluded to in a <a href="http://coryodaniel.com/index.php/2010/01/20/installing-mysql-from-dmg-on-mac-and-the-few-commands-to-make-it-work-on-the-command-line/">previous post.</a>.</p>
<p>I rebooted my laptop the other day and for some reason all of my tables (InnoDB) where corrupted... I couldn't get them to repair. All the *.frm files were present. Even when I did a 'show tables' they would show up, but whenever I issued any DML mysql responded saying the table did not exist.</p>
<p>So I decided to wipe out my MySQL install, because it just seemed funky. I decided to go the ports route, and I'm so used to the doing the bastardized old way of installing it</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> port <span style="color: #c20cb9; font-weight: bold;">install</span> mysql5 +server +devel</pre></td></tr></table></div>

<p>Then proceeding to do about 5000 things to get it to start at boot time and have a *.sock file in the right place.</p>
<p>Then I came across <a href="http://stackoverflow.com/questions/1081231/macports-doesnt-install-org-macports-mysql5-plist-with-mysql5-server">this post</a> while looking for a LaunchD file for MySQL. A comment by Mike Richards points out that there is a hip new (working) way of installing mysql with ports:</p>
<blockquote><p>
The mysql5 +server package variant in MacPorts is obsolete, and is superseded by the mysql5-server package, which you install in addition to mysql5. This allows you to build it after the fact, instead of re-compiling the entire mysql5 package with +server.</p>
<p>I'd suggest to just remove your old mysql5 +server, and install using the following.</p>
<p>sudo port install mysql5-server<br />
That'll build both the required mysql5 and mysql5-server packages for you, and you'll have the mysql5 plist file in /Library/LaunchDaemons. Also note that you no longer need to symlink your mysqld.sock to /tmp/mysql.sock.
</p></blockquote>
<p>Thanks Mike!</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> port <span style="color: #c20cb9; font-weight: bold;">install</span> mysql5-server</pre></td></tr></table></div>

<p>And who would of thunk it? It 'just works' (as a side note, the binary name is mysql5 incase you don't think it works when you type 'mysql').</p>
<p>Make sure you read all the output from Port. You'll need to load the LaunchD file in launchctl and either manually start MySQL the first time or just reboot and have OSX do it for you.</p>
<p>Yay. I can do some work now. </p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Installing+MySQL+on+Mac+OSX+w%2F+Ports+http://coryodaniel.com/?p=470" title="Post to Twitter"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://digg.com/submit?url=http://coryodaniel.com/index.php/2010/02/11/installing-mysql-on-mac-osx-w-ports/&amp;title=Installing+MySQL+on+Mac+OSX+w%2F+Ports" title="Post to Digg"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-digg-big2.png" alt="Post to Digg" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://coryodaniel.com/index.php/2010/02/11/installing-mysql-on-mac-osx-w-ports/&amp;t=Installing+MySQL+on+Mac+OSX+w%2F+Ports" title="Post to Facebook"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-facebook-big2.png" alt="Post to Facebook" /></a> <a class="tt" href="http://reddit.com/submit?url=http://coryodaniel.com/index.php/2010/02/11/installing-mysql-on-mac-osx-w-ports/&amp;title=Installing+MySQL+on+Mac+OSX+w%2F+Ports" title="Post to Reddit"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-reddit-big2.png" alt="Post to Reddit" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://coryodaniel.com/index.php/2010/02/11/installing-mysql-on-mac-osx-w-ports/&amp;title=Installing+MySQL+on+Mac+OSX+w%2F+Ports" title="Post to StumbleUpon"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-su-big2.png" alt="Post to StumbleUpon" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://coryodaniel.com/index.php/2010/02/11/installing-mysql-on-mac-osx-w-ports/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing MySQL from DMG on Mac (and the few commands to make it work on the command line)</title>
		<link>http://coryodaniel.com/index.php/2010/01/20/installing-mysql-from-dmg-on-mac-and-the-few-commands-to-make-it-work-on-the-command-line/</link>
		<comments>http://coryodaniel.com/index.php/2010/01/20/installing-mysql-from-dmg-on-mac-and-the-few-commands-to-make-it-work-on-the-command-line/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 22:30:08 +0000</pubDate>
		<dc:creator>Cory O'Daniel</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[quickfix]]></category>
		<category><![CDATA[stupid human tricks]]></category>

		<guid isPermaLink="false">http://coryodaniel.com/?p=419</guid>
		<description><![CDATA[When you install mysql from the DMG on Mac OS X, it leaves a few things missing.  Mysql binaries are missing from the path, and the sock file is being looked for in the wrong place by default.
Here is a quick fix:

1
2
3
echo &#34;export PATH=/usr/local/mysql/bin:\$PATH&#34; &#62;&#62; ~/.bash_login;
sudo mkdir -p /opt/local/var/run/mysql5;
sudo ln -s /tmp/mysql.sock /opt/local/var/run/mysql5/mysqld.sock;

Yay, now [...]]]></description>
			<content:encoded><![CDATA[<p>When you install mysql from the DMG on Mac OS X, it leaves a few things missing.  Mysql binaries are missing from the path, and the sock file is being looked for in the wrong place by default.</p>
<p>Here is a quick fix:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;export PATH=/usr/local/mysql/bin:<span style="color: #000099; font-weight: bold;">\$</span>PATH&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> ~<span style="color: #000000; font-weight: bold;">/</span>.bash_login;
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>mysql5;
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>mysql.sock <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>mysql5<span style="color: #000000; font-weight: bold;">/</span>mysqld.sock;</pre></td></tr></table></div>

<p>Yay, now you can rock out with your bad self.</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Installing+MySQL+from+DMG+on+Mac+%28and+the+few+commands+to+make+it+work+on+the+command+line%29+http://coryodaniel.com/?p=419" title="Post to Twitter"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://digg.com/submit?url=http://coryodaniel.com/index.php/2010/01/20/installing-mysql-from-dmg-on-mac-and-the-few-commands-to-make-it-work-on-the-command-line/&amp;title=Installing+MySQL+from+DMG+on+Mac+%28and+the+few+commands+to+make+it+work+on+the+command+line%29" title="Post to Digg"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-digg-big2.png" alt="Post to Digg" /></a> <a class="tt" href="http://www.facebook.com/share.php?u=http://coryodaniel.com/index.php/2010/01/20/installing-mysql-from-dmg-on-mac-and-the-few-commands-to-make-it-work-on-the-command-line/&amp;t=Installing+MySQL+from+DMG+on+Mac+%28and+the+few+commands+to+make+it+work+on+the+command+line%29" title="Post to Facebook"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-facebook-big2.png" alt="Post to Facebook" /></a> <a class="tt" href="http://reddit.com/submit?url=http://coryodaniel.com/index.php/2010/01/20/installing-mysql-from-dmg-on-mac-and-the-few-commands-to-make-it-work-on-the-command-line/&amp;title=Installing+MySQL+from+DMG+on+Mac+%28and+the+few+commands+to+make+it+work+on+the+command+line%29" title="Post to Reddit"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-reddit-big2.png" alt="Post to Reddit" /></a> <a class="tt" href="http://stumbleupon.com/submit?url=http://coryodaniel.com/index.php/2010/01/20/installing-mysql-from-dmg-on-mac-and-the-few-commands-to-make-it-work-on-the-command-line/&amp;title=Installing+MySQL+from+DMG+on+Mac+%28and+the+few+commands+to+make+it+work+on+the+command+line%29" title="Post to StumbleUpon"><img class="nothumb" src="http://coryodaniel.com/wp-content/plugins/tweet-this/icons/tt-su-big2.png" alt="Post to StumbleUpon" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://coryodaniel.com/index.php/2010/01/20/installing-mysql-from-dmg-on-mac-and-the-few-commands-to-make-it-work-on-the-command-line/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

