<?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>Jonathan Dean &#187; mysql</title>
	<atom:link href="http://www.jonathandean.com/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jonathandean.com</link>
	<description>Web Development and Design</description>
	<lastBuildDate>Fri, 03 Feb 2012 22:49:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Running PHP and MySQL with phpMyAdmin on OS X 10.5</title>
		<link>http://www.jonathandean.com/2009/06/running-php-and-mysql-with-phpmyadmin-on-os-x-105/</link>
		<comments>http://www.jonathandean.com/2009/06/running-php-and-mysql-with-phpmyadmin-on-os-x-105/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 00:32:27 +0000</pubDate>
		<dc:creator>Jonathan Dean</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.jonathandean.com/?p=311</guid>
		<description><![CDATA[Apache already comes pre-installed on OS X but PHP is not enabled by default. To enable PHP we need to edit our Apache config file by opening the Terminal and typing sudo nano /private/etc/apache2/httpd.conf and hitting enter (put in your admin password when it asks.) Type Control+W to bring up the search option and type ...]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>Apache already comes pre-installed on OS X but PHP is not enabled by default. To enable PHP we need to edit our Apache config file by opening the Terminal and typing <em>sudo nano /private/etc/apache2/httpd.conf </em>and hitting enter (put in your admin password when it asks.) Type Control+W to bring up the search option and type <em>php5_module</em> and hit enter. Remove the # from the beginning of that line and then type Control+X to exit, Y to save when it asks, and Enter to overwrite the same filename.</p>
<p>Next, we want to create our PHP config file since it isn&#8217;t there by default. In the Terminal type <em>cd /private/etc</em> and hit enter, then type <em>sudo cp php.ini.default php.ini</em> and hit enter. This makes a copy of the default configuration we can use to get started with. We&#8217;ll use that later. Now you can start up Apache by going to System Preferences, Sharing and checking the Web Sharing box. If it was already checked, uncheck it and then recheck it again to restart Apache to accept our changes.</p>
<p>Now you need to install MySQL. Luckily, there&#8217;s already an install package available at <a title="MySQL.com" href="http://mysql.com">MySQL.com</a> so head on over there and download the latest stable version of 5.X. Now extract the zip, open the dmg and run the .pkg installer. I would also recommend double-clicking the .prefPane file for quick access to startup and shutdown commands without needing the Terminal. I don&#8217;t necessarily recommend installing the MySQLStartupItem package unless you really need it. In fact, you really shouldn&#8217;t leave MySQL or your web server running at all when you aren&#8217;t using it.</p>
<p>Once MySQL is installed you need to start it up. If you installed the preference pane (the .prefPane file) you can just go into System Preferences and then click MySQL. From there just click the button to get it started. Now we are going to want to set a password for the root user. To do that just open up the Terminal and type <em>mysql</em> . If it can&#8217;t find the mysql command we can add it to your path by editing your bash profile. Just type <em>sudo nano ~/.bash_profile</em> in the Terminal to edit the file, entering your admin password when it asks. Then add a line that looks like this: <em>export PATH=/usr/local/mysql/bin:$PATH</em> and type Control+X, Y, Enter to quit and save your changes. Then you&#8217;ll need to reload your bash profile by typing <em>source ~/.bash_profile</em></p>
<p>Now you should be able to type <em>mysql</em> in the Terminal from any directory to connect to mysql. From the <em>mysql&gt; </em>prompt type the following, substituting <em>yourpassword</em> with your desired password and then hit enter: <em>set password for &#8216;root&#8217;@'localhost&#8217; = password(&#8216;yourpassword&#8217;);</em> To make sure it was effective, log out by typing <em>exit;</em> and then enter and log back in again but this time we want to supply our credentials. So type the following to show that we want to log in using the root user and a password: <em>mysql -u root -p</em></p>
<p>To make sure PHP can connect we need to edit our php configuration to know where the MySQL socket is located. For this type <em>sudo nano /private/etc/php.ini</em> from the Terminal. When the file opens type Control+W to bring up the search box and type in <em>mysql.default_socket</em> and hit enter. After the equals sign on that line enter <em>/tmp/mysql.sock</em> and and type Control+X, Y, Enter to quit and save your changes. Now we need to restart Apache for the change to take effect by going to System Preferences, Sharing and unchecking then rechecking the Web Sharing box. (Or via command-line if you wish.)</p>
<p>Now to install phpMyAdmin just download the latest and extract it into your Sites folder in your user account (/Users/<em>username</em>/Sites/) or the Apache root (/Library/WebServer/Documents/), whichever you prefer. Browse to that folder in the Terminal and type <em>mkdir config</em> to make the config folder and then <em>chmod o+rw config</em> to make it writable. Then browse to the setup folder in your browser, which would be http://localhost/~<em>user</em>/phpmyadmin/setup/ if you installed it in your user&#8217;s Sites folder or just http://localhost/phpmyadmin/setup/ if you put it in the Apache root. From there click the New Server button and then Save to take the defaults (unless you know other options you need) and then Save again in the Configuration File settings of the Overview page. Now you should be able to log into your server by going to either http://localhost/~<em>user</em>/phpmyadmin/ or http://localhost/phpmyadmin/ and entering your root username and password. It&#8217;s highly recommended that you create another user with fewer privledges to do most of your work, though.</p>
<p>If you also want to be able to use a .htaccess file you&#8217;ll need to go to the Terminal and type <em>sudo nano /private/etc/apache2/httpd.conf</em> to edit your Apache config file. Then type Control+W and search for <em>AllowOverride</em>. Change that option from <em>None</em> to <em>All</em> so that it reads <em>AllowOverride All</em> and then  type Control+X, Y, Enter to quit and save your changes. Now we need to do the same for each user account. Do this by typing <em>sudo nano /private/etc/apache2/users/</em>username<em>.conf</em> and making the same change. If you aren&#8217;t sure what users there are you can type <em>ls /private/etc/apache2/users/ . </em>After you make the changes you&#8217;ll need to restart Apache again.</p>
<p>Some of this I did today and other parts of it I did a while ago so if anyone wants to give it a run through and let me know how it turns out that would be great. I know it could use some screenshots but those will have to come later since I was already done with this when I decided to write the instructions out.</p>
<p>My final word on this is to be mindful of security and make sure no one who shouldn&#8217;t can access any applications that are running. I would recommend shutting down MySQL and Apache when you aren&#8217;t developing to keep risks to a minimum. I&#8217;m not going to go into security since I assume that you know what you&#8217;re doing but it was worth mentioning again that any servers running on your machine are a potential security risk if you don&#8217;t know how to keep it safe.</p>
<p>References:</p>
<p><a title="Foundation PHP" href="http://foundationphp.com/tutorials/php_leopard.php">http://foundationphp.com/tutorials/php_leopard.php</a></p>
<p><a title="MySQL Documentaion Tutorial" href="http://dev.mysql.com/doc/refman/5.1/en/tutorial.html">http://dev.mysql.com/doc/refman/5.1/en/tutorial.html</a></p>
<p><a title="phpMyAdmin Setup Tool" href="http://wiki.phpmyadmin.net/pma/Setup">http://wiki.phpmyadmin.net/pma/Setup</a></p>
<p><a title="Enabling .htaccess in OS X" href="http://www.clagnut.com/blog/350/">http://www.clagnut.com/blog/350/</a>  </p>
<div class="shr-publisher-311"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.jonathandean.com/2009/06/running-php-and-mysql-with-phpmyadmin-on-os-x-105/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Trying out a fulltext search i&#8230;</title>
		<link>http://www.jonathandean.com/2009/05/trying-out-a-fulltext-search-i/</link>
		<comments>http://www.jonathandean.com/2009/05/trying-out-a-fulltext-search-i/#comments</comments>
		<pubDate>Sat, 02 May 2009 19:48:22 +0000</pubDate>
		<dc:creator>Jonathan Dean</dc:creator>
				<category><![CDATA[Twitter Updates]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.jonathandean.com/2009/05/trying-out-a-fulltext-search-i/</guid>
		<description><![CDATA[Trying out a fulltext search index to see if that works as well as I hope]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>Trying out a fulltext search index to see if that works as well as I hope  </p>
<div class="shr-publisher-182"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.jonathandean.com/2009/05/trying-out-a-fulltext-search-i/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

