<?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>PHP Architect blog &#187; MySQL</title>
	<atom:link href="http://www.php-architect.com/blog/category/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.php-architect.com/blog</link>
	<description>PHP, MySQL, ZF, Python, Linux, Mac, C++, Java, Flex, Air, ActionScript &#38; apps development.</description>
	<lastBuildDate>Sun, 13 Jun 2010 18:25:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=2292</generator>
		<item>
		<title>Recruitment System &#8211; One of my projects</title>
		<link>http://www.php-architect.com/blog/2010/05/08/recruitment-system-one-of-my-projects/</link>
		<comments>http://www.php-architect.com/blog/2010/05/08/recruitment-system-one-of-my-projects/#comments</comments>
		<pubDate>Sat, 08 May 2010 14:57:04 +0000</pubDate>
		<dc:creator>Me2resh</dc:creator>
				<category><![CDATA[Favorites]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mail System]]></category>
		<category><![CDATA[My Work]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[Updates]]></category>
		<category><![CDATA[zend framework]]></category>
		<category><![CDATA[cha]]></category>
		<category><![CDATA[jobs]]></category>
		<category><![CDATA[recruitment]]></category>
		<category><![CDATA[zend]]></category>
		<category><![CDATA[zf]]></category>

		<guid isPermaLink="false">http://www.php-architect.com/blog/?p=390</guid>
		<description><![CDATA[I wanted to post this since a while. The recruitment system is one of the applications I built for cha-international while working there beside developing the Middle East &#38; North Africa travel awards system, mail marketing system, and converting all their servers from windows to Linux. In brief the system has the following features : [...]


Related posts:<ol><li><a href='http://www.php-architect.com/blog/2010/04/10/what-is-your-favorite-mac-app/' rel='bookmark' title='Permanent Link: What is your favorite MAC App?'>What is your favorite MAC App?</a></li>
<li><a href='http://www.php-architect.com/blog/2009/08/08/how-to-add-subtract-time-code-in-python/' rel='bookmark' title='Permanent Link: How to Add &#038; Subtract time code in Python'>How to Add &#038; Subtract time code in Python</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I wanted to post this since a while.</p>
<p>The <a title="PHP Recruitment System" href="http://www.cha-international.com/" target="_self">recruitment system</a> is one of the applications I built for <span style="color: #008000;"><a href="http://www.cha-international.com/" target="_blank">cha-international</a></span> while working there beside developing the <a title="MENA Travel Awards" href="http://www.menatravelawards.com" target="_blank">Middle East &amp; North Africa travel awards system</a>, mail marketing system, and converting all their servers from windows to Linux.</p>
<p>In brief the system has the following features :</p>
<ul>
<li>Backend :</li>
</ul>
<blockquote>
<ol>
<li>Managing countries, Nationalities, Languages, World Areas, System Announcements.</li>
<li>Managing Education Levels, Industries, Titles, Departments, System Reply Messages, Candidate Status, Candidates Classifications, and Quotes.</li>
<li>Testimonials section where the company can post its clients testimonials to be displayed in the frontend.</li>
<li>Managing 2 types of resumes : Uploaded Attachments, and Detailed filled forms Resumes.</li>
<li>Easy form for the data entry team to add the resumes from the backend.</li>
<li>Searching for candidates, using simple forms like name, email or advanced one which contains name, different nationalities, different languages, age, sex, industry, title, keyword in resume, etc.</li>
<li>Consultants area where they can post / close job posting, search  for candidates, export word version of resumes, add to their favorite list, recommend them to another consultant.</li>
<li>Consultants also can comment on the resumes, change their availability status to be seen by other consultants, and communicate with the candidate through the reply messages and keep track of those sent messages.</li>
<li>The system has a approval workflow engine, the admins have to check the resume to approve it first.</li>
<li>The system has a privileges section where the administrator can create a new role, assign access to certain areas in the backend to certain role, and assign the roles to system users.</li>
<li>Feedback system where the backend users can communicate with the administrator for support tickets, etc.</li>
<li>Auditrail system where every action in the system is logged.</li>
</ol>
</blockquote>
<ul>
<li>Frontend:</li>
</ul>
<blockquote>
<ol>
<li>Simple upload form where users can just upload their resume and simple details.</li>
<li>Advanced profile form where users can fill in all the details, and add many attachments to their profiles.</li>
<li>Listing, Simple search, advanced search for jobs, and applying to them.</li>
<li>Clients area where they can request certain services.</li>
<li>Featured profiles, where a certain profiles selected by the admins showed in frontend.</li>
</ol>
</blockquote>
<blockquote><p>The project was completely built from scratch using Zend Framework, and right now it has more than 70,000 applicant in its database, and the system is as fast as you see in the videos, these demos were taken with 50,000 record in the database.</p></blockquote>
<blockquote><p>Please don&#8217;t give me any feedback on the design <img src='http://www.php-architect.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> , I am just a developer.</p></blockquote>
<blockquote><p>Here is some videos describing the different features of the system, I will try to post a better quality ones later.</p>
<p style="text-align: center;">
<p style="text-align: center;"><strong>Change your Signature</strong></p>
</blockquote>
<blockquote>
<p style="text-align: center;"><object type="application/x-shockwave-flash" data="http://www.youtube.com/v/KXMg4q43Vf0&#038;fs=1" width="425" height="344"><param name="movie" value="http://www.youtube.com/v/KXMg4q43Vf0&#038;fs=1" /><param name="FlashVars" value="playerMode=embedded"/><param name="wmode" value="transparent"/></object></p>
<p style="text-align: center;">
<hr style="text-align: center;" />
<p style="text-align: center;"><strong>Search Resumes</strong></p>
<p style="text-align: center;"><object type="application/x-shockwave-flash" data="http://www.youtube.com/v/UUCuQ3XZmHg&#038;fs=1" width="425" height="344"><param name="movie" value="http://www.youtube.com/v/UUCuQ3XZmHg&#038;fs=1" /><param name="FlashVars" value="playerMode=embedded"/><param name="wmode" value="transparent"/></object></p>
<p style="text-align: center;">
<hr style="text-align: center;" />
<p style="text-align: center;"><strong>Apply as New Candidate</strong></p>
<p style="text-align: center;"><object type="application/x-shockwave-flash" data="http://www.youtube.com/v/UNMVIahQAeU&#038;fs=1" width="425" height="344"><param name="movie" value="http://www.youtube.com/v/UNMVIahQAeU&#038;fs=1" /><param name="FlashVars" value="playerMode=embedded"/><param name="wmode" value="transparent"/></object></p>
<p style="text-align: center;">
<hr style="text-align: center;" />
<p style="text-align: center;"><strong>Send Feedback to support</strong></p>
<p style="text-align: center;"><object type="application/x-shockwave-flash" data="http://www.youtube.com/v/-QiwYphCi2k&#038;fs=1" width="425" height="344"><param name="movie" value="http://www.youtube.com/v/-QiwYphCi2k&#038;fs=1" /><param name="FlashVars" value="playerMode=embedded"/><param name="wmode" value="transparent"/></object></p>
<p style="text-align: center;">
<hr style="text-align: center;" />
<p style="text-align: center;"><strong>Consultant Functionality walk through<br />
</strong></p>
<p style="text-align: center;"><object type="application/x-shockwave-flash" data="http://www.youtube.com/v/wU6MDYO-xsw&#038;fs=1" width="425" height="344"><param name="movie" value="http://www.youtube.com/v/wU6MDYO-xsw&#038;fs=1" /><param name="FlashVars" value="playerMode=embedded"/><param name="wmode" value="transparent"/></object></p>
<p style="text-align: center;">
<hr style="text-align: center;" />
<p style="text-align: center;"><strong>Check who applied for your job</strong></p>
<p style="text-align: center;"><object type="application/x-shockwave-flash" data="http://www.youtube.com/v/X7_ZNVjksKg&#038;fs=1" width="425" height="344"><param name="movie" value="http://www.youtube.com/v/X7_ZNVjksKg&#038;fs=1" /><param name="FlashVars" value="playerMode=embedded"/><param name="wmode" value="transparent"/></object></p>
<p style="text-align: center;">
<hr style="text-align: center;" />
<p style="text-align: center;"><strong>Apply for Posted Job</strong></p>
<p style="text-align: center;"><object type="application/x-shockwave-flash" data="http://www.youtube.com/v/B06xlZr8A-w&#038;fs=1" width="425" height="344"><param name="movie" value="http://www.youtube.com/v/B06xlZr8A-w&#038;fs=1" /><param name="FlashVars" value="playerMode=embedded"/><param name="wmode" value="transparent"/></object></p>
<p style="text-align: center;">
</blockquote>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.php-architect.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>

<p>Related posts:<ol><li><a href='http://www.php-architect.com/blog/2010/04/10/what-is-your-favorite-mac-app/' rel='bookmark' title='Permanent Link: What is your favorite MAC App?'>What is your favorite MAC App?</a></li>
<li><a href='http://www.php-architect.com/blog/2009/08/08/how-to-add-subtract-time-code-in-python/' rel='bookmark' title='Permanent Link: How to Add &#038; Subtract time code in Python'>How to Add &#038; Subtract time code in Python</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.php-architect.com/blog/2010/05/08/recruitment-system-one-of-my-projects/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to Add &amp; Subtract time code in Python</title>
		<link>http://www.php-architect.com/blog/2009/08/08/how-to-add-subtract-time-code-in-python/</link>
		<comments>http://www.php-architect.com/blog/2009/08/08/how-to-add-subtract-time-code-in-python/#comments</comments>
		<pubDate>Sat, 08 Aug 2009 07:58:20 +0000</pubDate>
		<dc:creator>Me2resh</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[edl]]></category>
		<category><![CDATA[media]]></category>
		<category><![CDATA[timecode]]></category>

		<guid isPermaLink="false">http://www.php-architect.com/blog/?p=167</guid>
		<description><![CDATA[I have been developing some tools for the media production lately, i found a neat way to add or subtract certain amount of seconds to a given time code. for example i have a video that starts from 12:45:05 and i want to add 59 seconds to it and use the new time. from datetime [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>I have been developing some tools for the media production lately, i found a neat way to add or subtract certain amount of seconds to a given time code.</p>
<p>for example i have a video that starts from 12:45:05 and i want to add 59 seconds to it and use the new time.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">from datetime import datetime
from datetime import timedelta
&nbsp;
<span style="color: #000000; font-weight: bold;">time</span> = datetime<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">2009</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">1</span>, <span style="color: #000000;">12</span>, <span style="color: #000000;">45</span>, 05, <span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">diff</span> = timedelta<span style="color: #7a0874; font-weight: bold;">&#40;</span>seconds = <span style="color: #000000;">59</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
final_time = <span style="color: #000000; font-weight: bold;">time</span> + <span style="color: #c20cb9; font-weight: bold;">diff</span></pre></div></div>

<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.php-architect.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>

<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.php-architect.com/blog/2009/08/08/how-to-add-subtract-time-code-in-python/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Zend Certified Engineer</title>
		<link>http://www.php-architect.com/blog/2009/05/21/zend-certified-engineer/</link>
		<comments>http://www.php-architect.com/blog/2009/05/21/zend-certified-engineer/#comments</comments>
		<pubDate>Thu, 21 May 2009 07:15:23 +0000</pubDate>
		<dc:creator>Me2resh</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[My Work]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Status]]></category>
		<category><![CDATA[Updates]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[certification]]></category>
		<category><![CDATA[php5]]></category>
		<category><![CDATA[zce]]></category>
		<category><![CDATA[zend]]></category>

		<guid isPermaLink="false">http://www.php-architect.com/blog/?p=321</guid>
		<description><![CDATA[Hi mates, finally i have got certified as Zend Certified Engineer on 10th of this month. i have been decided to take the exam since a year, but was too busy to hold myself at home and revise the manual and prepare for the exam, but this month i said this is it. The exam [...]


Related posts:<ol><li><a href='http://www.php-architect.com/blog/2010/05/08/recruitment-system-one-of-my-projects/' rel='bookmark' title='Permanent Link: Recruitment System &#8211; One of my projects'>Recruitment System &#8211; One of my projects</a></li>
<li><a href='http://www.php-architect.com/blog/2009/11/27/quick-dive-into-flash-builder-4-formerly-flex/' rel='bookmark' title='Permanent Link: Quick dive into Flash Builder 4 (formerly Flex)'>Quick dive into Flash Builder 4 (formerly Flex)</a></li>
<li><a href='http://www.php-architect.com/blog/2009/11/11/fix-for-zend-studio-7-button-problems-in-ubuntu-9-10-karmic-koala/' rel='bookmark' title='Permanent Link: Fix for Zend Studio 7 Button Problems in Ubuntu 9.10 &#8220;Karmic Koala&#8221;'>Fix for Zend Studio 7 Button Problems in Ubuntu 9.10 &#8220;Karmic Koala&#8221;</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Hi mates,</p>
<p>finally i have got certified as Zend Certified Engineer on 10th of this month.</p>
<p>i have been decided to take the exam since a year, but was too busy to hold myself at home and revise the manual and prepare for the exam, but this month i said this is it.</p>
<p>The exam is very tricky with lots of confusing questions, it tests your ability of thinking and your real experience with php, web development, security and many other topics that some people will not expect to exist in PHP exam, it is  real benchmarking to your abilities.</p>
<p>I must say that preaparing for the exam has opened various topics for me to dig deep in, and it was a great experience.</p>
<p>And being one of the only 2 certified in Egypt is cool <img src='http://www.php-architect.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.php-architect.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>

<p>Related posts:<ol><li><a href='http://www.php-architect.com/blog/2010/05/08/recruitment-system-one-of-my-projects/' rel='bookmark' title='Permanent Link: Recruitment System &#8211; One of my projects'>Recruitment System &#8211; One of my projects</a></li>
<li><a href='http://www.php-architect.com/blog/2009/11/27/quick-dive-into-flash-builder-4-formerly-flex/' rel='bookmark' title='Permanent Link: Quick dive into Flash Builder 4 (formerly Flex)'>Quick dive into Flash Builder 4 (formerly Flex)</a></li>
<li><a href='http://www.php-architect.com/blog/2009/11/11/fix-for-zend-studio-7-button-problems-in-ubuntu-9-10-karmic-koala/' rel='bookmark' title='Permanent Link: Fix for Zend Studio 7 Button Problems in Ubuntu 9.10 &#8220;Karmic Koala&#8221;'>Fix for Zend Studio 7 Button Problems in Ubuntu 9.10 &#8220;Karmic Koala&#8221;</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.php-architect.com/blog/2009/05/21/zend-certified-engineer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Build MySQL insert Query from Array that contains fields and values</title>
		<link>http://www.php-architect.com/blog/2009/02/22/build-mysql-insert-query-from-array-that-contains-fields-and-values/</link>
		<comments>http://www.php-architect.com/blog/2009/02/22/build-mysql-insert-query-from-array-that-contains-fields-and-values/#comments</comments>
		<pubDate>Sun, 22 Feb 2009 12:30:50 +0000</pubDate>
		<dc:creator>Me2resh</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[query]]></category>

		<guid isPermaLink="false">http://www.php-architect.com/blog/?p=261</guid>
		<description><![CDATA[The following function takes table name, and array where its keys are the table fields and it&#8217;s values are the values to insert in each field, it constructs the MySQL Query based on the input and executes it to insert the data. function insertRow&#40;$table_name, $input_array&#41;&#123; $link = mysql_connect&#40;SERVER, USER, PASS&#41;; mysql_select_db&#40;DATABASE, $link&#41;; $SQL = &#34;INSERT [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>The following function takes table name, and array where its keys are the table fields and it&#8217;s values are the values to insert in each field, it constructs the MySQL Query based on the input and executes it to insert the data.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> insertRow<span style="color: #009900;">&#40;</span><span style="color: #000088;">$table_name</span><span style="color: #339933;">,</span> <span style="color: #000088;">$input_array</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$link</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_connect</span><span style="color: #009900;">&#40;</span>SERVER<span style="color: #339933;">,</span> USER<span style="color: #339933;">,</span> PASS<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #990000;">mysql_select_db</span><span style="color: #009900;">&#40;</span>DATABASE<span style="color: #339933;">,</span> <span style="color: #000088;">$link</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$SQL</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;INSERT INTO <span style="color: #006699; font-weight: bold;">$table_name</span> &quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$fields</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;(&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$values</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;(&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$input_array</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$k</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$v</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$fields</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;`<span style="color: #006699; font-weight: bold;">$k</span>` ,&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$values</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;'<span style="color: #006699; font-weight: bold;">$v</span>' ,&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #000088;">$fields</span> <span style="color: #339933;">.=</span><span style="color: #0000ff;">&quot;#&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$values</span> <span style="color: #339933;">.=</span><span style="color: #0000ff;">&quot;#&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$fields</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;,#&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$fields</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$fields</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$fields</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$values</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;,#&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$values</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$values</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$values</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$fields</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;)&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$values</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;)&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$SQL</span> <span style="color: #339933;">.=</span> <span style="color: #000088;">$fields</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot; VALUES &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$values</span><span style="color: #339933;">;</span>
	<span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$SQL</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #990000;">mysql_close</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$link</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.php-architect.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>

<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.php-architect.com/blog/2009/02/22/build-mysql-insert-query-from-array-that-contains-fields-and-values/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>how to enable mod_rewrite in apache2.2 (debian/ubuntu)</title>
		<link>http://www.php-architect.com/blog/2008/06/18/how-to-enable-mod_rewrite-in-apache22-debianubuntu/</link>
		<comments>http://www.php-architect.com/blog/2008/06/18/how-to-enable-mod_rewrite-in-apache22-debianubuntu/#comments</comments>
		<pubDate>Wed, 18 Jun 2008 15:57:01 +0000</pubDate>
		<dc:creator>Me2resh</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://www.abdelaliem.com/?p=61</guid>
		<description><![CDATA[Here i am going to describe how to enable mod_rewrite in apache2.2 -specaily for debian. In default installion of apache2.2 on debian never enable mod_rewrite default. So you may need to enable . First install the apache2.2 with this command : debian user please use No related posts.


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Here i am going to describe how to enable mod_rewrite in apache2.2 -specaily for debian.</p>
<p>In default installion of apache2.2 on debian never enable mod_rewrite default. So you may need to enable .</p>
<p>First install the apache2.2 with this command :<br />
debian user please use </p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.php-architect.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>

<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.php-architect.com/blog/2008/06/18/how-to-enable-mod_rewrite-in-apache22-debianubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Architectural principles</title>
		<link>http://www.php-architect.com/blog/2008/06/05/architectural-principles/</link>
		<comments>http://www.php-architect.com/blog/2008/06/05/architectural-principles/#comments</comments>
		<pubDate>Thu, 05 Jun 2008 15:17:08 +0000</pubDate>
		<dc:creator>Me2resh</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[Favorites]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Updates]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://www.abdelaliem.com/?p=59</guid>
		<description><![CDATA[Each project must have a clear customer and deliver a real benefit. Don’t Repeat Yourself (DRY). Life is too short to spend your time re-inventing things. Be as simple as possible. Just do what we need to do now. Be as open as possible. Assume that all services can be accessed from outside the BBC, [...]


Related posts:<ol><li><a href='http://www.php-architect.com/blog/2009/11/27/quick-dive-into-flash-builder-4-formerly-flex/' rel='bookmark' title='Permanent Link: Quick dive into Flash Builder 4 (formerly Flex)'>Quick dive into Flash Builder 4 (formerly Flex)</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<ol>
<li>Each project must have a clear customer and deliver a real benefit.</li>
<li>Don’t Repeat Yourself (DRY). Life is too short to spend your time re-inventing things.</li>
<li>Be as simple as possible. Just do what we need to do now.</li>
<li>Be as open as possible. Assume that all services can be accessed from outside the BBC, by default.</li>
<li>Start simple, then iterate. Build the smallest thing you could possibly need, deploy it, then build applications on top of it. Think building blocks, not monoliths.</li>
<li>Don’t optimise prematurely. The service might not grow the way we think it will.</li>
<li>Build to scale. Think stateless, think content delivery networks, think database resilience.</li>
<li>Test often. So you know when you need to optimise. So you can maintain your code. So you can maintain your platform.</li>
<li>Evolve. Teams, systems, support structures. The platform. These principles!</li>
<li>Let it die. Be prepared to turn your system off, or change it unrecognisably.</li>
</ol>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.php-architect.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>

<p>Related posts:<ol><li><a href='http://www.php-architect.com/blog/2009/11/27/quick-dive-into-flash-builder-4-formerly-flex/' rel='bookmark' title='Permanent Link: Quick dive into Flash Builder 4 (formerly Flex)'>Quick dive into Flash Builder 4 (formerly Flex)</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.php-architect.com/blog/2008/06/05/architectural-principles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The future is PHP</title>
		<link>http://www.php-architect.com/blog/2008/06/04/the-future-is-php/</link>
		<comments>http://www.php-architect.com/blog/2008/06/04/the-future-is-php/#comments</comments>
		<pubDate>Wed, 04 Jun 2008 15:44:31 +0000</pubDate>
		<dc:creator>Me2resh</dc:creator>
				<category><![CDATA[JAVA]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Updates]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://www.abdelaliem.com/?p=57</guid>
		<description><![CDATA[With PHP continuing to gain massive support from programmers looking to expand their programming horizon, new versions of the language are likely to be geared towards solidifying its position as opposed to revolutionising. The job market is telling nothing but good news When Perl 6 was being designed, many huge changes were brought that alienated [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<div class="entrybody">
<div class="snap_preview">
<p>With PHP continuing to gain massive support from programmers looking to expand their programming horizon, new versions of the language are likely to be geared towards solidifying its position as opposed to revolutionising.</p>
<p style="text-align: center;"><a href="http://phpimpact.files.wordpress.com/2008/05/permanent-demand-trendaspx.png" rel="lightbox[51]"><img class="alignnone size-full wp-image-187" src="http://phpimpact.files.wordpress.com/2008/05/permanent-demand-trendaspx.png?w=480&amp;h=218" alt="" width="480" height="218" /></a><br />
<em>The job market is telling nothing but good news</em></p>
<p>When Perl 6 was being designed, many huge changes were brought that alienated a lot of developers &#8211; hopefully PHP will not go the same way.In the meantime, be happy that you have chosen such a popular language that is advancing so quickly &#8211; PHP is here to stay, and things are only going to get better.The simplicity of scripting language PHP means it will be more popular than Java for building Web-based applications, Internet browser pioneer <a href="http://en.wikipedia.org/wiki/Marc_Andreessen">Marc Andreessen</a> predicted in a speech in Burlingame, California, at the Zend/PHP Conference.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.php-architect.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>

<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.php-architect.com/blog/2008/06/04/the-future-is-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fix the MySQL PHP issue in Leopard (mysql.sock file)</title>
		<link>http://www.php-architect.com/blog/2008/01/07/fix-the-mysql-php-issue-in-leopard-mysqlsock-file/</link>
		<comments>http://www.php-architect.com/blog/2008/01/07/fix-the-mysql-php-issue-in-leopard-mysqlsock-file/#comments</comments>
		<pubDate>Mon, 07 Jan 2008 13:39:25 +0000</pubDate>
		<dc:creator>Me2resh</dc:creator>
				<category><![CDATA[Mac OS]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[arabic]]></category>
		<category><![CDATA[developer]]></category>
		<category><![CDATA[leopard]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[php5]]></category>

		<guid isPermaLink="false">http://www.abdelaliem.com/blog/?p=20</guid>
		<description><![CDATA[This is a known issue in Leopard, basically the system is looking for the mysql.sock file in the wrong place. Just need to create a symlink and you should be in business: sudo mkdir /var/mysql/ sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock No related posts.


No related posts.]]></description>
			<content:encoded><![CDATA[<p><span class="postbody">This is a known issue in Leopard, basically the system is looking for the mysql.sock file in the wrong place. Just need to create a symlink and you should be in business:</p>
<p>sudo mkdir /var/mysql/<br />
sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock </span></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.php-architect.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>

<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.php-architect.com/blog/2008/01/07/fix-the-mysql-php-issue-in-leopard-mysqlsock-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing MySQL on Mac OS X (Tested on Leopard)</title>
		<link>http://www.php-architect.com/blog/2008/01/07/installing-mysql-on-mac-os-x-tested-on-leopard/</link>
		<comments>http://www.php-architect.com/blog/2008/01/07/installing-mysql-on-mac-os-x-tested-on-leopard/#comments</comments>
		<pubDate>Mon, 07 Jan 2008 13:37:03 +0000</pubDate>
		<dc:creator>Me2resh</dc:creator>
				<category><![CDATA[Mac OS]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.abdelaliem.com/blog/?p=19</guid>
		<description><![CDATA[Found it very useful, hope you will too What follows are instructions for building and installing MySQL 5 on Mac OS X. These instructions should work perfectly on both Tiger and Leopard. If you’re a pro at this type of thing already, if you’re impatient, or just feeling lucky, you can download the basic install [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>Found it very useful, hope you will too</p>
<p class="entry-content">What follows are instructions for building and installing MySQL 5 on Mac <span class="caps">OS X</span>. These instructions should work perfectly on both Tiger and Leopard.</p>
<p>If you’re a pro at this type of thing already, if you’re impatient, or just feeling lucky, you can <a onclick="javascript:pageTracker._trackPageview ('/outbound/hivelogic.com');" href="http://hivelogic.com/downloads/hivelogic_mysql_setup.sh">download the basic install steps as a shell script</a> and give that a go. Just make sure you’ve installed Xcode and set your path correctly (if that doesn’t make sense, you should keep reading).</p>
<h3>Why You Might Want to Build MySQL Yourself</h3>
<p>So why would you want to compile your own version of MySQL when the MySQL team releases a Mac <span class="caps">OS X</span> build that you can download and install in one step? There are a few reasons:</p>
<ol>
<li>As of today (2007-11-09) there isn’t a MySQL package-installer for Leopard, and the Tiger one has a few issues</li>
<li>You’ll have a stand-alone, easy-to-update version of MySQL that you control and understand</li>
<li>When a new version of MySQL comes out, you won’t have to wait for the MySQL team to release a package for Mac <span class="caps">OS X</span> (or for <em>your version</em> of Mac <span class="caps">OS X</span>) … just download the latest source and follow the steps – they never change</li>
<li>You can easily uninstall MySQL yourself at any time</li>
<li>Compiling software yourself lets you learn how Mac <span class="caps">OS X</span> and the software you use really work behind the scenes</li>
</ol>
<p>But … there are some downsides, too:</p>
<ol>
<li>You won’t get a Preference Pane to start/stop MySQL (unless <a onclick="javascript:pageTracker._trackPageview ('/outbound/manton.org');" href="http://manton.org/">Mantorg</a> agrees to build us one. Idea: email him and tell him you want him to)</li>
<li>It takes about 20 minutes to build and install</li>
</ol>
<p>In the end, compiling and installing MySQL this way is well worth the effort, as the end result delivers an easy-to-upgrade, system-independent, stand-alone development platform that is impervious to potential problems that can be caused by system updates, operating system upgrades, etc.</p>
<p>By rolling our own from source this way, we also have full control over our environment. We know what’s installed and where, what version we’ve used, where it came from, and there’s no dependence on an external ports system and the breakage or issues that come from relying on others to manage our software.</p>
<p>These issues and additional background information about <em>why</em> one might roll their own tools in this fashion are detailed in the article, <a onclick="javascript:pageTracker._trackPageview ('/outbound/hivelogic.com');" href="http://hivelogic.com/narrative/articles/using_usr_local">Using /usr/local/</a>, which could be considered a prerequisite for this task.</p>
<h3>A Quick Warning</h3>
<p>While it’s unlikely anything we do here might do any kind of damage to the system, it’s good advice to have a current backup of everything, just in case. I don’t take any responsibility for anything that results from following these instructions. You’re following these instructions at your own risk.</p>
<h3>Prerequisites</h3>
<p>You’ll need to install Xcode. Xcode can be found in the <em>Optional Installs</em> folder of the installation <span class="caps">DVD</span>. You can also download the latest version from Apple by getting a (free) membership from the <a onclick="javascript:pageTracker._trackPageview ('/outbound/developer.apple.com');" href="http://developer.apple.com/">Apple Developer Connection</a>.</p>
<p>Just double click the Xcode installer package, take the defaults, and you’ll be ready to roll.</p>
<h3>A Note About Existing MySQL Installations</h3>
<p>If you already have MySQL installed and used the package installer from MySQL to install it, you need to remove a single file (actually a <a onclick="javascript:pageTracker._trackPageview ('/outbound/en.wikipedia.org');" href="http://en.wikipedia.org/wiki/Symlink">symlink</a>) to disable it:</p>
<pre>sudo rm /usr/local/mysql</pre>
<p>If you also installed the StartupItem package, you’ll want to remove it as well. Keep in mind that if you ever want to auto-start the <em>old</em> version of MySQL later on, you’ll need to re-download the package installer and reinstall the StartupItem.</p>
<pre>sudo rm -rf /Library/StartupItems/MySQLCOM/</pre>
<p>Exporting or migrating your old data isn’t difficult, but it is beyond the scope of this article. I may write something up to handle this in a subsequent article if it’s something people want.</p>
<h3>Terminal</h3>
<p>We’re going to be typing archaic commands into a window using a <a onclick="javascript:pageTracker._trackPageview ('/outbound/dejavu.sourceforge.net');" href="http://dejavu.sourceforge.net/wiki/index.php/Main_Page">monospaced font</a>, just like <em>in a movie!</em> And if things go well, later, your life-sized avatar will learn kung-fu.</p>
<p>Open the Terminal application. It can be found in the <code>/Applications/Utilities</code> folder.</p>
<p>Each of the lines below appearing in monospaced type should be entered into Terminal, and be followed by the Return key. But you knew that already.</p>
<h3>Setting the Path</h3>
<p><strong><em>Do not skip this step! Most everything else will fail if you do.</em></strong></p>
<p>Mac <span class="caps">OS X</span>, like other <span class="caps">UNIX</span> systems, uses something called a <em>path</em> to determine where it should look for applications on the command line (that is, when you’re using the Terminal app). The path is actually an environment variable, set by a special file that’s automatically executed when you open a new Terminal window.</p>
<p>To see if the path has been set properly, we can check the contents of the <code>.bash_login</code> file (the special file hidden in our home folder) for a <code>PATH</code> line using a text editor.  <a onclick="javascript:pageTracker._trackPageview ('/outbound/macromates.com');" href="http://macromates.com/">TextMate</a>, <a onclick="javascript:pageTracker._trackPageview ('/outbound/www.barebones.com');" href="http://www.barebones.com/products/textwrangler/index.shtml">TextWrangler</a>, <a onclick="javascript:pageTracker._trackPageview ('/outbound/www.barebones.com');" href="http://www.barebones.com/products/bbedit/index.shtml">BBEdit</a>, and <a onclick="javascript:pageTracker._trackPageview ('/outbound/en.wikipedia.org');" href="http://en.wikipedia.org/wiki/Vi">vi</a> are all perfectly good options. To open the file with TextMate, for example, we can type:</p>
<pre>mate ~/.bash_login</pre>
<p>This will open the file if it already exists, or open a blank file if it doesn’t.  Add the following line <strong>at the very end of the file</strong>:</p>
<pre>export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"</pre>
<p>Now save and close the file.</p>
<p>It doesn’t matter how many other lines there are in the file, or what they say or do. Just make sure that this line comes <em>last</em> and you should be fine.</p>
<p>To make sure the changes are picked up correctly, we now need to execute the file with the following command:</p>
<pre>. ~/.bash_login</pre>
<p>It’s likely there will be no response from the shell here, just the prompt, but that’s OK, the changes have been picked up and we’re ready to move on.</p>
<p>You can also close your Terminal and open a new one instead if you’d like.</p>
<h3>Setting Up</h3>
<p>I like to create a folder to contain the MySQL source code file and build folder. This way, I can later <em>uninstall</em> MySQL easily, as well as download and compile new versions, all in one place.</p>
<p>For these examples, we’ll create a folder called <code>src</code> in our home folder, and change directories into that folder. It will be our workspace for everything we do here:</p>
<pre>mkdir -p ~/src
cd ~/src</pre>
<p>You’ll download and compile everything in this new folder.</p>
<h3>Download, Extract, Etc.</h3>
<p>Now we’re ready to start the real work. Just type (or cut-n-paste) each one of the following lines into Terminal, one by one. When one line finishes (some will take a while and dump a lot of information to the screen), enter the next one.</p>
<p>This will first download and then expand the MySQL source code distribution:</p>
<pre>curl -O http://mysql.he.net/Downloads/MySQL-5.0/mysql-5.0.45.tar.gz
tar xzvf mysql-5.0.45.tar.gz
cd mysql-5.0.45</pre>
<p>You then need to configure MySQL:</p>
<pre>CC=gcc CFLAGS="-O3 -fno-omit-frame-pointer" CXX=gcc \
CXXFLAGS="-O3 -fno-omit-frame-pointer -felide-constructors \
-fno-exceptions -fno-rtti" \
./configure --prefix=/usr/local/mysql \
--with-extra-charsets=complex --enable-thread-safe-client \
--enable-local-infile --enable-shared</pre>
<p>When that process completes, you can initiate the actual compilation process:</p>
<pre>make</pre>
<p>This part can take a while. Now is a good time to go and get yourself a tasty beverage.</p>
<p>The last part of the build process is where MySQL actually gets installed. <strong>You’ll be prompted for your password here</strong>, because this is where files actually get written to their actual locations:</p>
<pre>sudo make install</pre>
<p>Next, we need to setup the initial databases and privileges. You may be prompted for your password again:</p>
<pre>cd /usr/local/mysql
sudo ./bin/mysql_install_db --user=mysql
sudo chown -R mysql ./var</pre>
<p>That’s it, MySQL is installed. But you’re not done yet.</p>
<h3>Auto-Starting MySQL</h3>
<p>Now that the install is done, you need to have MySQL auto-start every time you start or reboot your Mac. The easiest way to do this is using <a onclick="javascript:pageTracker._trackPageview ('/outbound/developer.apple.com');" href="http://developer.apple.com/macosx/launchd.html">launchd</a>.</p>
<p>I’ve prepared a launchd plist file that will manage MySQL, starting it at boot and stopping it cleanly at shutdown. Create a file named <code>com.mysql.mysqld.plist</code> using the text-editor of your choice, and save it to your Desktop. Enter the following text into the file:</p>
<pre>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
    &lt;key&gt;KeepAlive&lt;/key&gt;
    &lt;true/&gt;
    &lt;key&gt;Label&lt;/key&gt;
    &lt;string&gt;com.mysql.mysqld&lt;/string&gt;
    &lt;key&gt;Program&lt;/key&gt;
    &lt;string&gt;/usr/local/mysql/bin/mysqld_safe&lt;/string&gt;
    &lt;key&gt;RunAtLoad&lt;/key&gt;
    &lt;true/&gt;
    &lt;key&gt;UserName&lt;/key&gt;
    &lt;string&gt;mysql&lt;/string&gt;
    &lt;key&gt;WorkingDirectory&lt;/key&gt;
    &lt;string&gt;/usr/local/mysql&lt;/string&gt;
&lt;/dict&gt;
&lt;/plist&gt;</pre>
<p>Now we need to move the file into place and set the permissions on it. You may be prompted for your password again:</p>
<pre>sudo mv ~/Desktop/com.mysql.mysqld.plist /Library/LaunchDaemons
sudo chown root /Library/LaunchDaemons/com.mysql.mysqld.plist</pre>
<p>With the file in place, the last step is to tell launchd to load and startup MySQL. You may be prompted for your password again:</p>
<pre>sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysqld.plist</pre>
<p>If things go well, you won’t see anything special happen, but MySQL will have started up. You can verify this, again back in Terminal:</p>
<pre>mysql -uroot</pre>
<p>This will initiate MySQL’s command-line monitor. If everything went well, you should see something like this:</p>
<pre>Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.45 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql&gt;</pre>
<p>If you see that, that’s it, you’re done! Type <code>exit</code> to quit the MySQL monitor.</p>
<p>If you see something else, verify that your paths are set correctly and try the command again. If things still don’t work, it’s likely that something didn’t work and the compile didn’t finish. Try going through the steps once more and see if you can catch any error messages.</p>
<h3>Starting and Stopping MySQL Manually</h3>
<p>If you ever want to stop MySQL manually, use this command in Terminal, entering you password when prompted:</p>
<pre>sudo launchctl unload -w /Library/LaunchDaemons/com.mysql.mysqld.plist</pre>
<p>To start it manually, use this command in Terminal, entering you password when prompted:</p>
<pre>sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysqld.plist</pre>
<h3>A Note about Security</h3>
<p>The easiest way to secure your MySQL installation without affecting the way you (or your applications) will need to communicate with it is to limit anything but local connections to your MySQL server. In other words, only you and the apps you run on your own Mac will be able to connect. You won’t need to enter passwords when interacting with MySQL locally, and won’t need to tweak the default <code>database.yml</code> files that Rails creates, for example.</p>
<p>We can limit access by creating (or editing) the <code>/etc/my.cnf</code> file. If you have TextMate installed, you can enter the following command to create (or edit) the file:</p>
<pre>mate /etc/my.cnf</pre>
<p>If you use BBEdit, you’d use this command:</p>
<pre>bbedit /etc/my.cnf</pre>
<p>The handy bit about using TextMate (or BBEdit) for this task is that it will handle authentication and setting permissions for you.</p>
<p>Enter the following text into the file save it and close it, authenticating as needed:</p>
<pre>[mysqld]
bind-address = 127.0.0.1</pre>
<p>Thanks to my friend <a title="Show me all the blueprints" onclick="javascript:pageTracker._trackPageview ('/outbound/clarkware.com');" href="http://clarkware.com/cgi/blosxom">Mike Clark</a> for this tip.</p>
<p>If limiting access isn’t enough for you, you can read about setting a root access password for MySQL in <a onclick="javascript:pageTracker._trackPageview ('/outbound/dev.mysql.com');" href="http://dev.mysql.com/doc/refman/5.1/en/default-privileges.html">this article</a>.</p>
<h3>Baking-In the MySQL Bindings</h3>
<p>You can gain some bigtime Rails-to-MySQL speed improvements by building the MySQL C bindings for Ruby.</p>
<p>If you have an Intel Mac, just run the following command (entering your password when prompted):</p>
<pre>sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config</pre>
<p>If you have a <span class="caps">PPC</span> Mac (I hear some still exist), you’d enter:</p>
<pre>sudo env ARCHFLAGS="-arch ppc" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config</pre>
<p>You’ll see a prompt asking you which gem to install:</p>
<pre>Select which gem to install for your platform (universal-darwin9.0)
 1. mysql 2.7.3 (mswin32)
 2. mysql 2.7.1 (mswin32)
 3. mysql 2.7 (ruby)
 4. mysql 2.6 (ruby)
 5. Skip this gem
 6. Cancel installation</pre>
<p>Pick the option closest to the top that ends in “(ruby)”. In the example above, we’d want to select option 3.</p>
<h3>Uninstalling MySQL</h3>
<p>In case you one day decide that you’d like to remove MySQL, it’s easy to do when building from source:</p>
<pre>cd ~/src/mysql-5.0.45
sudo make uninstall
sudo launchctl unload -w /Library/LaunchDaemons/com.mysql.mysqld.plist
sudo rm /Library/LaunchDaemons/com.mysql.mysqld.plist</pre>
<h3>That’s It</h3>
<p>So, you’re done. What are you waiting for? Go create the next Google or something.</p>
<p>Special thanks to <a onclick="javascript:pageTracker._trackPageview ('/outbound/www.therailsway.com');" href="http://www.therailsway.com/">Koz</a>, <a onclick="javascript:pageTracker._trackPageview ('/outbound/clarkware.com');" href="http://clarkware.com/cgi/bloxsom">Mike Clark</a>, <a onclick="javascript:pageTracker._trackPageview ('/outbound/ryanschwartz.net');" href="http://ryanschwartz.net/">Ryan Schwartz</a>, and <a onclick="javascript:pageTracker._trackPageview ('/outbound/railsenvy.com');" href="http://railsenvy.com/">Jason Seifer</a> for their tips and suggestions.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.php-architect.com/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>

<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.php-architect.com/blog/2008/01/07/installing-mysql-on-mac-os-x-tested-on-leopard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
