<?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>Web Development &#38; Stuff &#187; MySQL</title>
	<atom:link href="http://web-development-blog.co.uk/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://web-development-blog.co.uk</link>
	<description>Some interesting findings from web-dev land...</description>
	<lastBuildDate>Mon, 02 Apr 2012 15:10:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Mysql multiple conditional joins with conditional select</title>
		<link>http://web-development-blog.co.uk/2010/05/15/mysql-multiple-conditional-joins-with-conditional-select/</link>
		<comments>http://web-development-blog.co.uk/2010/05/15/mysql-multiple-conditional-joins-with-conditional-select/#comments</comments>
		<pubDate>Sat, 15 May 2010 09:18:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://web-development-blog.co.uk/?p=332</guid>
		<description><![CDATA[For my own records but may also be of interest to some&#8230;
This statement performs 4 conditional left outer joins and then uses CASE to conditionally select the returned columns as a single group of columns. 
So a polymorphic one to one relationship is returned in a single query.
123456789101112131415$sql = &#60;&#60;&#60;SQL
SELECT *, ELT(Log.action,'$elt_list') AS what,
&#160;CASE WHEN [...]]]></description>
			<content:encoded><![CDATA[<p>For my own records but may also be of interest to some&#8230;</p>
<p>This statement performs 4 conditional left outer joins and then uses CASE to conditionally select the returned columns as a single group of columns. </p>
<p>So a polymorphic one to one relationship is returned in a single query.</p>
<div class="codecolorer-container php " style="overflow:auto;white-space:nowrap;width:100%"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br /></div></td><td><div class="php codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="re0">$sql</span> <span class="sy0">=</span> <span class="co3">&lt;&lt;&lt;SQL<br />
SELECT *, ELT(Log.action,'$elt_list') AS what,<br />
&nbsp;CASE WHEN Friend.source_type = '$typeVisitor' THEN 'Anonymous Visitor' WHEN Friend.source_type = '$typeRecipient' THEN 'Referrer' WHEN Friend.source_type = '$typeDiVisitor' THEN 'DI visitor' WHEN Friend.source_type = '$typeFriend' THEN 'Friend' ELSE NULL END as 'source',<br />
&nbsp;CASE WHEN Friend.source_type = '$typeVisitor' THEN Visitor.title WHEN Friend.source_type = '$typeRecipient' THEN Recipient.title WHEN Friend.source_type = '$typeDiVisitor' THEN DiVisitor.title WHEN Friend.source_type = '$typeFriend' THEN RefFriend.title ELSE NULL END as 'Source.title',<br />
&nbsp;CASE WHEN Friend.source_type = '$typeVisitor' THEN Visitor.firstname WHEN Friend.source_type = '$typeRecipient' THEN Recipient.firstname WHEN Friend.source_type = '$typeDiVisitor' THEN DiVisitor.firstname WHEN Friend.source_type = '$typeFriend' THEN RefFriend.firstname ELSE NULL END as 'Source.firstname',<br />
&nbsp;CASE WHEN Friend.source_type = '$typeVisitor' THEN Visitor.surname WHEN Friend.source_type = '$typeRecipient' THEN Recipient.surname WHEN Friend.source_type = '$typeDiVisitor' THEN DiVisitor.surname WHEN Friend.source_type = '$typeFriend' THEN RefFriend.surname ELSE NULL END as 'Source.surname',<br />
&nbsp;CASE WHEN Friend.source_type = '$typeVisitor' THEN Visitor.email WHEN Friend.source_type = '$typeRecipient' THEN Recipient.email WHEN Friend.source_type = '$typeDiVisitor' THEN DiVisitor.email WHEN Friend.source_type = '$typeFriend' THEN RefFriend.email ELSE NULL END as 'Source.email'<br />
&nbsp;FROM friends AS Friend <br />
&nbsp;LEFT OUTER JOIN visitors AS Visitor ON (Visitor.id = Friend.source_id) AND (Friend.source_type = '$typeVisitor')<br />
&nbsp;LEFT OUTER JOIN visitors AS Recipient ON (Recipient.id = Friend.source_id) AND (Friend.source_type = '$typeRecipient')<br />
&nbsp;LEFT OUTER JOIN di_visitors AS DiVisitor ON (DiVisitor.id = Friend.source_id) AND (Friend.source_type = '$typeDiVisitor')<br />
&nbsp;LEFT OUTER JOIN friends AS RefFriend ON (RefFriend.id = Friend.source_id) AND (Friend.source_type = '$typeFriend'),<br />
&nbsp;log_table AS Log<br />
&nbsp;WHERE Log.model_id=Friend.id AND Log.type=$tf<br />
SQL</span><span class="sy0">;</span></div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://web-development-blog.co.uk/2010/05/15/mysql-multiple-conditional-joins-with-conditional-select/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL query with nested statement in parent where clause</title>
		<link>http://web-development-blog.co.uk/2009/11/16/mysql-query-with-nested-statement-in-parent-where-clause/</link>
		<comments>http://web-development-blog.co.uk/2009/11/16/mysql-query-with-nested-statement-in-parent-where-clause/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 17:24:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://web-development-blog.co.uk/?p=252</guid>
		<description><![CDATA[Quick reminder for myself of how to do a nested MySQL query with the nested statement in the parent where clause:
12345678910$sql = &#60;&#60;&#60;SQL
SELECT id
&#160;FROM invoices as Invoice
&#160;WHERE id NOT IN (
&#160; SELECT parent_id 
&#160; FROM invoices 
&#160; WHERE parent_id &#62; 0
&#160; GROUP BY parent_id &#160; &#160;
&#160;) AND billing_start &#60;= '$end'
SQL;
]]></description>
			<content:encoded><![CDATA[<p>Quick reminder for myself of how to do a nested MySQL query with the nested statement in the parent where clause:</p>
<div class="codecolorer-container php " style="overflow:auto;white-space:nowrap;width:100%"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br /></div></td><td><div class="php codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="re0">$sql</span> <span class="sy0">=</span> <span class="co3">&lt;&lt;&lt;SQL<br />
SELECT id<br />
&nbsp;FROM invoices as Invoice<br />
&nbsp;WHERE id NOT IN (<br />
&nbsp; SELECT parent_id <br />
&nbsp; FROM invoices <br />
&nbsp; WHERE parent_id &gt; 0<br />
&nbsp; GROUP BY parent_id &nbsp; &nbsp;<br />
&nbsp;) AND billing_start &lt;= '$end'<br />
SQL</span><span class="sy0">;</span></div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://web-development-blog.co.uk/2009/11/16/mysql-query-with-nested-statement-in-parent-where-clause/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Query MySQL for records that were created within the last 7 days/week</title>
		<link>http://web-development-blog.co.uk/2009/10/02/query-mysql-for-records-that-were-created-within-the-last-7-daysweek/</link>
		<comments>http://web-development-blog.co.uk/2009/10/02/query-mysql-for-records-that-were-created-within-the-last-7-daysweek/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 15:22:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux servers]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://web-development-blog.co.uk/?p=191</guid>
		<description><![CDATA[You can use this in your MySQL WHERE clause to return records that were created within the last 7 days/week:
1created &#62;= DATE_SUB&#40;CURDATE&#40;&#41;,INTERVAL 7 day&#41;
You can also use NOW() in the subtraction to give hh:mm:ss resolution. So to return records created exactly (to the second) within the last 24hrs, you could do:
1created &#62;= DATE_SUB&#40;NOW&#40;&#41;,INTERVAL 1 day&#41;
]]></description>
			<content:encoded><![CDATA[<p>You can use this in your MySQL WHERE clause to return records that were created within the last 7 days/week:</p>
<div class="codecolorer-container mysql " style="overflow:auto;white-space:nowrap;width:100%"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br /></div></td><td><div class="mysql codecolorer" style="font-family:Monaco,Lucida Console,monospace">created <span class="sy1">&gt;=</span> <span class="kw17">DATE_SUB</span><span class="br0">&#40;</span><span class="kw17">CURDATE</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy2">,</span><span class="kw11">INTERVAL</span> <span class="nu0">7</span> <span class="kw9">day</span><span class="br0">&#41;</span></div></td></tr></tbody></table></div>
<p>You can also use NOW() in the subtraction to give hh:mm:ss resolution. So to return records created exactly (to the second) within the last 24hrs, you could do:</p>
<div class="codecolorer-container mysql " style="overflow:auto;white-space:nowrap;width:100%"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br /></div></td><td><div class="mysql codecolorer" style="font-family:Monaco,Lucida Console,monospace">created <span class="sy1">&gt;=</span> <span class="kw17">DATE_SUB</span><span class="br0">&#40;</span><span class="kw17">NOW</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy2">,</span><span class="kw11">INTERVAL</span> <span class="nu0">1</span> <span class="kw9">day</span><span class="br0">&#41;</span></div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://web-development-blog.co.uk/2009/10/02/query-mysql-for-records-that-were-created-within-the-last-7-daysweek/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL indexes &#8211; query performance increase</title>
		<link>http://web-development-blog.co.uk/2009/02/25/mysql-indexes-query-performance-increase/</link>
		<comments>http://web-development-blog.co.uk/2009/02/25/mysql-indexes-query-performance-increase/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 11:54:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Eco friendly / green computing]]></category>
		<category><![CDATA[Linux servers]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Web development]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://web-development-blog.co.uk/?p=76</guid>
		<description><![CDATA[Today I had a log table report query that contained a nested query. It was taking ages (5mins) to complete. I investigated indexes which I had been meaning to look at for a while. Anyway I managed to bring down the query to 0.04s &#8211; I now have much love for indexes!!
Basic MySQL syntax:
1CREATE INDEX [...]]]></description>
			<content:encoded><![CDATA[<p>Today I had a log table report query that contained a nested query. It was taking ages (5mins) to complete. I investigated indexes which I had been meaning to look at for a while. Anyway I managed to bring down the query to 0.04s &#8211; I now have much love for indexes!!</p>
<p>Basic MySQL syntax:</p>
<div class="codecolorer-container sql " style="overflow:auto;white-space:nowrap;width:100%"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br /></div></td><td><div class="sql codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="kw1">CREATE</span> <span class="kw1">INDEX</span> index_name <span class="kw1">ON</span> table_name<span class="br0">&#40;</span>column_name<span class="br0">&#41;</span>;</div></td></tr></tbody></table></div>
<p>You can also create indexes when you create a table. In this example I&#8217;m indexing id,landing_id,page_id and action_id with INDEX (id,landing_id,page_id,action_id):</p>
<div class="codecolorer-container sql " style="overflow:auto;white-space:nowrap;width:100%"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br /></div></td><td><div class="sql codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="kw1">CREATE</span> <span class="kw1">TABLE</span> <span class="kw1">IF</span> <span class="kw1">NOT</span> <span class="kw1">EXISTS</span> visitor_actions <span class="br0">&#40;</span><br />
&nbsp; id INT <span class="kw1">UNSIGNED</span> <span class="kw1">NOT</span> <span class="kw1">NULL</span> <span class="kw1">AUTO_INCREMENT</span> <span class="kw1">PRIMARY</span> <span class="kw1">KEY</span><span class="sy0">,</span><br />
&nbsp; landing_id INT <span class="kw1">UNSIGNED</span> <span class="kw1">NOT</span> <span class="kw1">NULL</span><span class="sy0">,</span><br />
&nbsp; page_id TINYINT <span class="kw1">UNSIGNED</span> <span class="kw1">NOT</span> <span class="kw1">NULL</span><span class="sy0">,</span><br />
&nbsp; action_id TINYINT <span class="kw1">UNSIGNED</span> <span class="kw1">NOT</span> <span class="kw1">NULL</span><span class="sy0">,</span><br />
&nbsp; dwell_time MEDIUMINT <span class="kw1">UNSIGNED</span> <span class="kw1">NULL</span><span class="sy0">,</span><br />
&nbsp; start TINYINT <span class="kw1">UNSIGNED</span> <span class="kw1">NOT</span> <span class="kw1">NULL</span><span class="sy0">,</span><br />
&nbsp; created_at DATETIME <span class="kw1">NOT</span> <span class="kw1">NULL</span><span class="sy0">,</span><br />
&nbsp; <span class="kw1">INDEX</span> <span class="br0">&#40;</span>id<span class="sy0">,</span>landing_id<span class="sy0">,</span>page_id<span class="sy0">,</span>action_id<span class="br0">&#41;</span><br />
<span class="br0">&#41;</span> ENGINE<span class="sy0">=</span>INNODB;</div></td></tr></tbody></table></div>
<p>I&#8217;ll add to this post when I spend some more time looking at the different index types.</p>
]]></content:encoded>
			<wfw:commentRss>http://web-development-blog.co.uk/2009/02/25/mysql-indexes-query-performance-increase/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>MySQL TIMEDIFF calculate time difference in query</title>
		<link>http://web-development-blog.co.uk/2009/02/24/mysql-timediff-calculate-time-difference-in-query/</link>
		<comments>http://web-development-blog.co.uk/2009/02/24/mysql-timediff-calculate-time-difference-in-query/#comments</comments>
		<pubDate>Tue, 24 Feb 2009 15:20:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Web development]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://web-development-blog.co.uk/?p=74</guid>
		<description><![CDATA[Handy, brings you back a time difference in hh:mm:ss format inside an MySQL query:
1TIMEDIFF&#40;date_time_one, date_time_two&#41;
]]></description>
			<content:encoded><![CDATA[<p>Handy, brings you back a time difference in hh:mm:ss format inside an MySQL query:</p>
<div class="codecolorer-container sql " style="overflow:auto;white-space:nowrap;width:100%"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br /></div></td><td><div class="sql codecolorer" style="font-family:Monaco,Lucida Console,monospace">TIMEDIFF<span class="br0">&#40;</span>date_time_one<span class="sy0">,</span> date_time_two<span class="br0">&#41;</span></div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://web-development-blog.co.uk/2009/02/24/mysql-timediff-calculate-time-difference-in-query/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Dump MySQL file of database table schema (structure)</title>
		<link>http://web-development-blog.co.uk/2009/02/18/dump-mysql-file-of-database-table-schema-structure/</link>
		<comments>http://web-development-blog.co.uk/2009/02/18/dump-mysql-file-of-database-table-schema-structure/#comments</comments>
		<pubDate>Wed, 18 Feb 2009 18:23:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux servers]]></category>
		<category><![CDATA[Web development]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://web-development-blog.co.uk/?p=50</guid>
		<description><![CDATA[To dump an SQL file of just the schema (structure) of a MySQL database table you can use this command line:
1mysqldump -du username -p databasename tablename &#62; filename.sql
You can drop the -p if you don&#8217;t have a password.
Useful if you need to move table structures around ;]
]]></description>
			<content:encoded><![CDATA[<p>To dump an SQL file of just the schema (structure) of a MySQL database table you can use this command line:</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:100%"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br /></div></td><td><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">mysqldump -du username -p databasename tablename &gt; filename.sql</div></td></tr></tbody></table></div>
<p>You can drop the -p if you don&#8217;t have a password.</p>
<p>Useful if you need to move table structures around ;]</p>
]]></content:encoded>
			<wfw:commentRss>http://web-development-blog.co.uk/2009/02/18/dump-mysql-file-of-database-table-schema-structure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL search and replace query</title>
		<link>http://web-development-blog.co.uk/2009/01/22/mysql-search-and-replace-query/</link>
		<comments>http://web-development-blog.co.uk/2009/01/22/mysql-search-and-replace-query/#comments</comments>
		<pubDate>Thu, 22 Jan 2009 12:51:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web development]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://web-development-blog.co.uk/2009/01/22/mysql-search-and-replace-query/</guid>
		<description><![CDATA[For my own records:
1UPDATE tablename SET tablefield = REPLACE&#40;tablefield,&#34;findstring&#34;,&#34;replacestring&#34;&#41;;
]]></description>
			<content:encoded><![CDATA[<p>For my own records:</p>
<div class="codecolorer-container sql " style="overflow:auto;white-space:nowrap;width:100%"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br /></div></td><td><div class="sql codecolorer" style="font-family:Monaco,Lucida Console,monospace"><span class="kw1">UPDATE</span> tablename <span class="kw1">SET</span> tablefield <span class="sy0">=</span> <span class="kw1">REPLACE</span><span class="br0">&#40;</span>tablefield<span class="sy0">,</span><span class="st0">&quot;findstring&quot;</span><span class="sy0">,</span><span class="st0">&quot;replacestring&quot;</span><span class="br0">&#41;</span>;</div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://web-development-blog.co.uk/2009/01/22/mysql-search-and-replace-query/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL export SQL query as file</title>
		<link>http://web-development-blog.co.uk/2009/01/18/mysql-export-sql-query-as-file/</link>
		<comments>http://web-development-blog.co.uk/2009/01/18/mysql-export-sql-query-as-file/#comments</comments>
		<pubDate>Sun, 18 Jan 2009 10:35:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux servers]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Web development]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Shell]]></category>

		<guid isPermaLink="false">http://web-development-blog.co.uk/2009/01/18/mysql-export-sql-query-as-file/</guid>
		<description><![CDATA[This will dump an SQL statement into a file:
1mysql -u username -p database_name -e &#34;SQL_STATEMENT&#34; &#38;gt; file.data
]]></description>
			<content:encoded><![CDATA[<p>This will dump an SQL statement into a file:</p>
<div class="codecolorer-container html4strict " style="overflow:auto;white-space:nowrap;width:100%"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br /></div></td><td><div class="html4strict codecolorer" style="font-family:Monaco,Lucida Console,monospace">mysql -u username -p database_name -e &quot;SQL_STATEMENT&quot; <span class="sc1">&amp;gt;</span> file.data</div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://web-development-blog.co.uk/2009/01/18/mysql-export-sql-query-as-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>64bit PHP 5.2.5 compile error (Fedora Core 8)</title>
		<link>http://web-development-blog.co.uk/2008/03/23/64bit-php-525-compile-error-fedora-core-8/</link>
		<comments>http://web-development-blog.co.uk/2008/03/23/64bit-php-525-compile-error-fedora-core-8/#comments</comments>
		<pubDate>Sun, 23 Mar 2008 18:53:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux servers]]></category>
		<category><![CDATA[Web development]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://web-development-blog.co.uk/2008/03/23/64bit-php-525-compile-error-fedora-core-8/</guid>
		<description><![CDATA[I recently moved over to the 64bit version of Fedora Core 8.
My plan was to compile both Apache and PHP from source, as they require a fair amount of customisations for my needs.
The Apache compile went without problems but using my regular configure directives for PHP (5.2.5) threw this error:
1configure: error: mysql configure failed. Please [...]]]></description>
			<content:encoded><![CDATA[<p>I recently moved over to the 64bit version of Fedora Core 8.</p>
<p>My plan was to compile both Apache and PHP from source, as they require a fair amount of customisations for my needs.</p>
<p>The Apache compile went without problems but using my regular configure directives for PHP (5.2.5) threw this error:</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:100%"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br /></div></td><td><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">configure: error: mysql configure failed. Please check config.log for more information.</div></td></tr></tbody></table></div>
<p>This confused me a little and I spent quite some time investigating possible issues with MySQL. The config.log was pretty useless!</p>
<p>After a fair amount of reading I came across this directive that solved the issue (should have known!):</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:100%"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br /></div></td><td><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">--with-libdir=lib64</div></td></tr></tbody></table></div>
<p>So my final configure command looked like this:</p>
<div class="codecolorer-container text " style="overflow:auto;white-space:nowrap;width:100%"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="line-numbers"><div>1<br /></div></td><td><div class="text codecolorer" style="font-family:Monaco,Lucida Console,monospace">./configure --with-apxs2=/usr/local/apache2/bin/apxs &lt;strong&gt;--with-libdir=lib64&lt;/strong&gt; --with-mysql --with-zlib-dir=/usr/include/ --with-openssl --with-curl --with-config-file-path=/etc/php.ini</div></td></tr></tbody></table></div>
<p>No more errors! Joy ;]</p>
]]></content:encoded>
			<wfw:commentRss>http://web-development-blog.co.uk/2008/03/23/64bit-php-525-compile-error-fedora-core-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

