<?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>Gabriel de Kadt &#187; MySQL</title>
	<atom:link href="http://www.lazydada.com/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lazydada.com</link>
	<description>Personal notes on Mac based web development and design.</description>
	<lastBuildDate>Tue, 03 Aug 2010 18:01:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>MAMP stacked (Mac OS X 10.6)</title>
		<link>http://www.lazydada.com/2009-11-16/mamp-stacked-mac-os-x-10-6/</link>
		<comments>http://www.lazydada.com/2009-11-16/mamp-stacked-mac-os-x-10-6/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 23:01:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web design & development]]></category>
		<category><![CDATA[10.6]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[MacOSX]]></category>
		<category><![CDATA[MAMP]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.lazydada.com/?p=489</guid>
		<description><![CDATA[When I moved over to Mac OS X 10.6 last week I found I had to fix my MAMP stack. My old MAMP install didn&#8217;t work anymore as unfortunately Marc Liyanage&#8217;s excellent PHP package fails in 10.6. The following instructions are mostly the same as before &#8211; except it&#8217;s not quite so easy now &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>When I moved over to Mac OS X 10.6 last week I found I had to fix my <acronym>MAMP</acronym> stack. My <a href="/2009-06-05/mamp-stacked/">old MAMP install</a> didn&#8217;t work anymore as unfortunately Marc Liyanage&#8217;s <a href="http://www.entropy.ch/software/macosx/php/">excellent PHP package</a> fails in 10.6.</p>
<p>The following instructions are mostly the same as before &#8211; except it&#8217;s not quite so easy now &#8211; if you want more than a base PHP install that is. (I even had another look at the commercial MAMP Pro offering. Nah.) For a simple MAMP stack you really only need to turn on Apple&#8217;s PHP package and grab a copy of MySQL. If easy is good for you &#8211; jump to 1.5.</p>
<p>But I &#8220;like&#8221; to have phpMyAdmin and don&#8217;t like being warned that I&#8217;m missing the mcrypt extension for PHP. If you want mcrypt too &#8211; start at #1.</p>
<p>Tools &amp; Requirements:</p>
<ul>
<li>You need admin access on your Mac</li>
<li>Basic understanding of the filesystem and Terminal.app</li>
<li>If you&#8217;ve not got it already grab the wonderful and free editor TextWrangler. The config files that need editing are hidden from normal view- but easily reached by TextWrangler which even has a menu item for that: File / Open hidden&#8230; .  It also handles authentication beautifully to allow saving without having to manually change permissions to and fro.</li>
</ul>
<p>1. <del>[extra steps to customise things first eg add mcrypt PHP extension - if you don't need/want it skip past to 1.5.] Go and see <a href="http://blog.xeonxai.com/">Xeon Xai&#8217;s</a> blog post <a href="http://blog.xeonxai.com/2009/09/02/146/">Snow Leopard PHP Extensions Installation Tutorial</a> or for a quicker version &#8211; go <a href="http://adam.yanalunas.com/blog/archives/62">here</a>.</del> These first optional steps to customising your set up (adding PHP extensions and even downgrading PHP from 5.3. to 5.2) has turned out to be more &#8220;intereseting&#8221; than originally percieved and needs post of its own&#8230;</p>
<p>1.5 Prepare your php.ini file by duplicating the supplied stock example file and givining it the right name: In Terminal paste this:</p>
<p><code> sudo cp /private/etc/php.ini.default /private/etc/php.ini </code></p>
<p>You&#8217;ll need to edit the timezone &#8211; replace</p>
<p><code>;date.timezone = </code> with<br />
<code> date.timezone = Europe/Madrid</code></p>
<p>For other timezones look to the official list <a title="timezones for php" href="http://php.net/manual/en/timezones.php">here</a> (note the lost semi colon &#8211; that&#8217;s the comment character)</p>
<p>1.6 Get PHP looking in the right place for MySQL (once you&#8217;ve installed it.) &#8230;Still editing php.ini find and replace all instances of <code>/var/mysql/mysql.sock</code> with <code>/tmp/mysql.sock</code> . (Why? &#8211; well as documented <a href="http://dev.mysql.com/doc/refman/5.1/en/mysql-installation-macosx-notes.html">here</a> it seems php.ini is configured for Mac OS X Server&#8217;s bundled version of MySQL)</p>
<p>1.7 Start PHP by un-commenting the <code>LoadModule php5_module</code> line in your /etc/apache2/http.conf file.</p>
<p>1.8 Turn Web Sharing (in System Preferences/Sharing) off-and-on again.</p>
<p>2. Get yourself <a href="http://patrickgibson.com/utilities/virtualhost/">virtualhost.sh</a> from Patrick Gibson. This little shell script will make the process of setting up proper virtual domains on your development server a cinch. I use &#8220;.dev&#8221; or &#8220;.live&#8221; as the TLD to prevent any conflict with the live sites. (Although now I&#8217;ve started using Git I may just drop the separation between live and development branch domains on my development box. I still put all my sites in my ~/Sites folder though.</p>
<p>3. MySQL<br />
3.1 If you&#8217;ve already got another version installed <a href="http://steveno.wordpress.com/2009/03/26/uninstall-mysql-on-mac-os-x/">uninstal MySQL from your Mac</a>. NB &#8211; this will delete your databases too! But you&#8217;ve got those backed up and you want a clean slate:</p>
<ul>
<li> sudo rm /usr/local/mysql</li>
<li>sudo rm -rf /usr/local/mysql*</li>
<li>sudo rm -rf /Library/StartupItems/MySQLCOM</li>
<li>sudo rm -rf /Library/PreferencePanes/My*</li>
<li>edit /etc/hostconfig and remove the line MYSQLCOM=-YES-</li>
<li>sudo rm -rf /Library/Receipts/mysql*</li>
<li>sudo rm -rf /Library/Receipts/MySQL*</li>
</ul>
<p>3.2 Get a <a href="http://dev.mysql.com/downloads/">MySQL Community Server</a> for the Mac and install it.</p>
<p>4. Give your MySQL root user a password; type the following into the Terminal:<br />
<code>/usr/local/mysql/bin/mysqladmin -u root password sniggle</code><br />
&#8230;if you like <code>sniggle</code> as a passowrd that is.</p>
<p>5. Now you can administer your MySQL server with <a href="http://www.phpmyadmin.net/home_page/index.php">phpMyAdmin</a> and the root user you&#8217;ve just defined.  (There are other tools too &#8211; eg MySQL Administrator &#8211; but I&#8217;m used to phpMyAdmin from the hosting packeges I use). You may want to virtualhost phpMyAdmin to, for example, &#8220;http://mysql/&#8221;. Love virtualhost.sh.</p>
<p>6. Then for each [dynamic] site you&#8217;ll probably want to add a user and then associate a DB with that user. Do this in phpMyAdmin in one step using the Privileges pane fill in &#8220;Add a new User&#8221;/then select &#8220;Create database with same name and grant all privileges&#8221;. Job&#8217;s a good &#8216;un.</p>
<p>Done and not long-winded at-all at-all!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lazydada.com/2009-11-16/mamp-stacked-mac-os-x-10-6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MAMP stacked (Mac OS X 10.5)</title>
		<link>http://www.lazydada.com/2009-06-05/mamp-stacked/</link>
		<comments>http://www.lazydada.com/2009-06-05/mamp-stacked/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 22:17:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web design & development]]></category>
		<category><![CDATA[10.5]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[MacOSX]]></category>
		<category><![CDATA[MAMP]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://www.lazydada.com/?p=350</guid>
		<description><![CDATA[UPDATE: I&#8217;ve upgraded to Snow Leopard (Mac OS X 10.6) and the following instructions are no longer entirely valid as Marc Liyanage&#8217;s PHP package hasn&#8217;t been upgraded to work in the Snow. Want to get MAMP on Mac OS X 10.6? If you&#8217;re on 10.5 you may read on&#8230; Want to roll a MAMP stack [...]]]></description>
			<content:encoded><![CDATA[<p>UPDATE: I&#8217;ve upgraded to Snow Leopard (Mac OS X 10.6) and the following instructions are no longer entirely valid as Marc Liyanage&#8217;s PHP package hasn&#8217;t been upgraded to work in the Snow.</p>
<p>Want to get <a href="/2009-11-16/mamp-stacked-mac-os-x-10-6/">MAMP on Mac OS X 10.6</a>?</p>
<p>If you&#8217;re on 10.5 you may read on&#8230;</p>
<p>Want to roll a <acronym>MAMP</acronym> stack of your own to enable proper local web development? Try these steps to getting you own development environment:</p>
<p>1. Swap the Apple package of PHP for Marc Liyanage&#8217;s package of <a href="http://www.entropy.ch/software/macosx/php/">PHP for Mac OS X</a>. Read his notes &#8211; only takes a minute. His version has useful &#8220;extras&#8221; like the mcrypt extension that Apple doesn&#8217;t include: you&#8217;ll want that for phpMyAdmin. (If you&#8217;ve already started Apple&#8217;s version &#8211; you&#8217;ll know how to stop it by re-commenting the <code>LoadModule php5_module</code> line in your http.conf file )</p>
<p>2. Get yourself <a href="http://patrickgibson.com/utilities/virtualhost/">virtualhost.sh</a> from Patrick Gibson. This little shell script will make the process of setting up proper virtual domains on your development server a cinch. I use &#8220;.dev&#8221; or &#8220;.live&#8221; as the TLD to prevent any conflict with the live sites. (Although now I&#8217;ve started using Git I may just drop the separation between live and development branch domains on my development box. I still put all my sites in my ~/Sites folder though.</p>
<p>3. Get a <a href="http://dev.mysql.com/downloads/mysql/5.0.html">Mac OS X MySQL package</a> &#8211; (not the latest build but v5.0.x) from the good folks at MySQL. If you&#8217;ve already got another version installed &#8211; here&#8217;s <a href="http://steveno.wordpress.com/2009/03/26/uninstall-mysql-on-mac-os-x/">how to uninstal MySQL from a Mac</a> (NB &#8211; this will delete your databases too!).</p>
<p>4. Give your MySQL root user a password; type the following into the Terminal:<br />
<code>/usr/local/mysql/bin/mysqladmin -u root password sniggle</code><br />
&#8230;if you like <code>sniggle</code> as a passowrd that is.</p>
<p>5. Now you can administer your MySQL server with <a href="http://www.phpmyadmin.net/home_page/index.php">phpMyAdmin</a> and the root user you&#8217;ve just defined.  (There are other tools too &#8211; eg MySQL Administrator &#8211; but I&#8217;m used to phpMyAdmin from the hosting packeges I use). You may want to virtualhost phpMyAdmin to, for example, &#8220;http://mysql/&#8221;. Love virtualhost.sh.</p>
<p>6. Then for each [dynamic] site you&#8217;ll probably want to add a user and then associate a DB with that user. Do this in phpMyAdmin in one step using the Privileges pane fill in &#8220;Add a new User&#8221;/then select &#8220;Create database with same name and grant all privileges&#8221;. Job&#8217;s a good &#8216;un.</p>
<p>Done and not long-winded at-all at-all!</p>
<p>[Originally posted as a reply in <a href="http://groups.google.com/group/coda-users/browse_thread/thread/80323da5039c2581">Panic's Coda forum</a>... Lots of love for MAMP Pro - a serious contender - and for just 40€... ]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lazydada.com/2009-06-05/mamp-stacked/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[MAMP stack] OpenGoo install in Mac OS X 10.5</title>
		<link>http://www.lazydada.com/2009-04-21/opengoo-install-in-mac-os-x-105/</link>
		<comments>http://www.lazydada.com/2009-04-21/opengoo-install-in-mac-os-x-105/#comments</comments>
		<pubDate>Tue, 21 Apr 2009 17:29:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web design & development]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[MacOSX]]></category>
		<category><![CDATA[MAMP]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Project management]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://www.lazydada.com/?p=283</guid>
		<description><![CDATA[DON&#8217;T READ THIS! READ THIS. Or How to setup a MAMP Stack on&#8230; Mac OS X: a proper write up. Please disregard the gubbins on this post&#8230; [OK - this was going to be a simple step-by-step account of how to install a particular project management system on a Mac OS X box. That particular [...]]]></description>
			<content:encoded><![CDATA[<p>DON&#8217;T READ THIS! <a href="/2009-06-05/mamp-stacked/">READ THIS</a>.</p>
<h3>Or <span style="color: #000000;"><span style="text-decoration: none;"><a href="/2009-06-05/mamp-stacked/">How to setup a MAMP Stack on&#8230; Mac OS X</a>:</span></span> a proper write up.</h3>
<p>Please disregard the gubbins on this post&#8230;</p>
<p>[OK - this was going to be a simple step-by-step account of how to install  a particular project management system on a Mac OS X box. That particular project stalled but I learnt a few things about how to get a [M]AMP stack setup to the point a which I can continue&#8230; ]</p>
<p>Need a project management package. So far requirements and research lead to Open Goo.</p>
<ul style="text-align: left; ">
<li>Download package from <a href="http://www.opengoo.org/downloads.html">OpenGoo</a>.</li>
<li>Create a MySQL database for it.
<ul>
<li>Download and instal <a href="http://www.phpmyadmin.net/">PHP My Admin</a>. <a href="http://www.phpmyadmin.net/documentation/">Nice documentation</a>.</li>
</ul>
<ul style="text-align: left; ">
<li>
<ul style="text-align: left; ">
<li>[unstuff it and put the folder into ~/Sites/ , for example]</li>
<li>virtualhost it</li>
</ul>
<ul style="text-align: left; ">
<li>setup config.inc.php with <a href="http://www.geektimedesign.com/geek-stuff/tools-blowfish-generator.cfm">blowfish key</a></li>
</ul>
</li>
<li><span style="text-decoration: line-through;">f</span><span style="text-decoration: line-through;">ix socket error (?)</span>
<ul style="text-align: left; ">
<li><span style="text-decoration: line-through;">http://dev.mysql.com/doc/refman/5.0/en/mac-os-x-installation.html: edit (with TextWrangler of course) /etc/php.ini so that  &#8221;mysql.default_socket = /tmp/mysql.sock&#8221;</span></li>
</ul>
</li>
<li><span style="text-decoration: line-through;">Fix mcrypt error: &#8220;Cannot load </span><a href="http://php.net/mcrypt" target="Documentation"><em><span style="text-decoration: line-through;">mcrypt</span></em></a><span style="text-decoration: line-through;"> extension. Please check your PHP configuration&#8221;</span></li>
<li>Ditch the default OS X PHP install in favour of Marc Liyanage&#8217;s packaged instal of <a href="http://www.entropy.ch/software/macosx/php/">PHP for Mac OS X</a>
<ul style="text-align: left; ">
<li>If already set up the Apple version of PHP &#8211; make sure it&#8217;s disabled:  &#8221;<code>LoadModule php5_module</code>&#8220;  in <code>/private/etc/apache2/httpd.conf</code> shoul commented out</li>
<li>Download and run Marc&#8217;s installer from the link above. RTFM mind &#8211; but it&#8217;s a cinch. The new PHP files will now be in <code>/usr/local/php5</code>.</li>
<li>Also <a href="http://steveno.wordpress.com/2009/03/26/uninstall-mysql-on-mac-os-x/">ditch any previously installed MySQL</a>
<ul style="text-align: left; ">
<li>sudo rm /usr/local/mysql</li>
<li>sudo rm -rf /usr/local/mysql*</li>
<li>sudo rm -rf /Library/StartupItems/MySQLCOM</li>
<li>sudo rm -rf /Library/PreferencePanes/My*</li>
<li>edit /etc/hostconfig and remove the line MYSQLCOM=-YES-</li>
<li>sudo rm -rf /Library/Receipts/mysql*</li>
<li>sudo rm -rf /Library/Receipts/MySQL*</li>
</ul>
</li>
</ul>
</li>
<li>install to match the PHP  package to <a href="http://dev.mysql.com/downloads/mysql/5.0.html">MySQL 5.0.77</a></li>
</ul>
</li>
<li>Create a privileged MySQL user. (Any user may log in without  a password to get an anonymous session: &#8220;No Privileges&#8221;. Mac OS X user account &#8211; or _mysql. At this stage  log in without a password.)
<ul style="text-align: left; ">
<li><a href="http://www.phpmyadmin.net/documentation/#intro">phpMyAdmin can manage a whole MySQL server (needs a super-user) as well as a single database. To accomplish the latter you&#8217;ll need a properly set up MySQL user who can read/write only the desired database. It&#8217;s up to you to look up the appropriate part in the MySQL manual.</a></li>
</ul>
</li>
<li>Ye-har! Who&#8217;d of guessed&#8230; <a href="http://developer.apple.com/internet/opensource/osdb.html">Apple&#8217;s MySQL documentation</a> was where to find simple instructions for how to give the MySQL root user a password &#8211; and hence succeed to log inwith privileges. Terminal command: <code>/usr/local/mysql/bin/mysqladmin -u root password sniggle</code>. Where sniggle is your choice for a secure password.</li>
<li>For each DB user you should add that user with an MySQL query:<br />
<code>CREATE USER 'user1'@'localhost' IDENTIFIED BY'pass1';</code></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.lazydada.com/2009-04-21/opengoo-install-in-mac-os-x-105/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL and phpMyAdmin on Mac 10.5 Leopard</title>
		<link>http://www.lazydada.com/2009-02-19/mysql-and-phpmyadmin-on-mac-105-leopard/</link>
		<comments>http://www.lazydada.com/2009-02-19/mysql-and-phpmyadmin-on-mac-105-leopard/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 12:36:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web design & development]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[mcrypt]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.lazydada.com/2009-02-19/mysql-and-phpmyadmin-on-mac-105-leopard/</guid>
		<description><![CDATA[[Update! Lots of gotcha's with using the Apple package of PHP - found that its easier to do a couple of resets as noted here] Following on from PHP and SSI set-up on a Mac OS X 10.5, now it&#8217;s time for MySQL database work. Everything is plain sailing to start with: get and install [...]]]></description>
			<content:encoded><![CDATA[<p>[Update! Lots of gotcha's with using the Apple package of PHP - found that its easier to do a couple of resets as noted <a href="/2009-04-21/opengoo-install-in-mac-os-x-105/">here</a>]</p>
<p>Following on from <a href="http://www.lazydada.com/2008-11-07/apache-with-php-and-ssi-on-mac-os-x-105-leopard-in-two-minutes/">PHP and SSI set-up on a Mac OS X 10.5</a>, now it&#8217;s time for MySQL database work. Everything is plain sailing to start with: get and install both <a href="http://dev.mysql.com/downloads/" target="_blank">MySQL</a> and <a href="http://www.phpmyadmin.net/home_page/downloads.php" target="_blank">phpMyAdmin</a>. Then the first snag &#8211; phpMyAdmin cannot make a secure connection to MySQL without mcrypt (a PHP encryption extension) &#8211; and PHP as shipped with Mac OS X doesn&#8217;t come with this.</p>
<p>No solutions here I&#8217;m afraid &#8211; I&#8217;m in a hurry to get the development copy of a site I&#8217;m working on ASAP so have just commented out the blowfish and cookies lines in the phpMyAdmin config.inc.php file.</p>
<p>Must get this fixed&#8230;</p>
<p>Next problem: default MySQL setup looks in the wrong place for the socket connection. In Leopard the socket sits here <code>/private/tmp/mysql.sock</code>. Edit two lines in the MySQL sections of <code>/etc/php.ini</code> so as to get:</p>
<p><code>mysql.default_socket = /private/tmp/mysql.sock</code> and</p>
<p><code> mysqli.default_socket = /private/tmp/mysql.sock</code></p>
<p>Next problem&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lazydada.com/2009-02-19/mysql-and-phpmyadmin-on-mac-105-leopard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->