<?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>» DoYourself.org &#187; MySQL</title>
	<atom:link href="http://www.doyourself.org/category/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.doyourself.org</link>
	<description>Did you know ?</description>
	<lastBuildDate>Fri, 03 Feb 2012 23:00:02 +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>PHP cannot connect to mysql when run inside Apache</title>
		<link>http://www.doyourself.org/mysql/788-php-cannot-connect-to-mysql-when-run-inside-apache/</link>
		<comments>http://www.doyourself.org/mysql/788-php-cannot-connect-to-mysql-when-run-inside-apache/#comments</comments>
		<pubDate>Fri, 30 Jul 2010 23:41:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Dev]]></category>

		<guid isPermaLink="false">http://www.doyourself.org/?p=788</guid>
		<description><![CDATA[I ran into a very strange issue when Apache/PHP/MySQL. What happend was my php code suddenly cannot connect to mysql on another machine any more. The error message is: mysqli_connect() [function.mysqli-connect]: (HY000/2003): Can't connect to MySQL server on '218.241.156.222' (13) The strange thing was that if I connect mySQL from command line, even run the [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I ran into a very strange issue when Apache/PHP/MySQL.<br />
What happend was my php code suddenly cannot connect to mysql on another machine any more. The error message is:</p>
<pre>mysqli_connect() [function.mysqli-connect]: (HY000/2003): Can't connect to MySQL server on '218.241.156.222' (13)</pre>
<p>The  strange thing was that if I connect mySQL from command line, even run  the same code by php directly from command line, it worked just fine.</p>
<p>After searched around, I finally found the answer. Looks like it has something to do with SELinux settings.</p>
<p>To fix the issue, I only need to run:</p>
<pre>setsebool httpd_can_network_connect_db 1</pre>
<p>Before I ran the script, the file content of /selinux/booleans/httpd_can_network_connect_db was:<br />
0 0</p>
<p>After I ran the script, content changed to:<br />
1 1</p>
]]></content:encoded>
			<wfw:commentRss>http://www.doyourself.org/mysql/788-php-cannot-connect-to-mysql-when-run-inside-apache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mysql query &#8211; out of memory problem</title>
		<link>http://www.doyourself.org/mysql/552-mysql-query-out-of-memory-problem/</link>
		<comments>http://www.doyourself.org/mysql/552-mysql-query-out-of-memory-problem/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 19:01:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[-]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[of]]></category>
		<category><![CDATA[out]]></category>
		<category><![CDATA[problem:]]></category>
		<category><![CDATA[query]]></category>

		<guid isPermaLink="false">http://www.doyourself.org/?p=552</guid>
		<description><![CDATA[Hi, Every time I access &#8216;admin/logs/referrers&#8217; page I have this error: Warning: mysql_query() [function.mysql-query]: Unable to save result set in /home/morazzia/public_html/includes/database.mysql.inc on line 102 Warning: Out of memory (Needed 1048506 bytes) query: pager_query SELECT COUNT(DISTINCT(url)) FROM accesslog WHERE url &#60;&#62; &#8221; AND url NOT LIKE &#8216;%www.morazzia.com%&#8217; in /home/morazzia/public_html/includes/database.mysql.inc on line 121 I am on dedicated [...]]]></description>
			<content:encoded><![CDATA[<p></p><div class="content">
<p>Hi, </p>
<p>Every time I access &#8216;admin/logs/referrers&#8217; page I have this error:</p>
<p><strong>Warning: mysql_query() [function.mysql-query]: Unable to<br />
save result set in<br />
/home/morazzia/public_html/includes/database.mysql.inc on line 102</strong></p>
<p>Warning: Out of memory (Needed 1048506 bytes) query: pager_query<br />
SELECT COUNT(DISTINCT(url)) FROM accesslog WHERE url &lt;&gt; &#8221; AND<br />
url NOT LIKE &#8216;%www.morazzia.com%&#8217; in<br />
/home/morazzia/public_html/includes/database.mysql.inc on line 121</p>
<p>I am on dedicated server running dual core 3.4Mhz with 2gb of<br />
memory. I have 10k visitors and 120.000 page views per day. I enable<br />
cash support on drupal with cron job (every 4 hours). I enable deval<br />
module. This is first couple of lines in deval log for referrers page:</p>
<p><em>Executed 122 queries in 100.85 milliseconds. Queries taking<br />
longer than 5 ms and queries executed more than once, are<br />
highlighted.Page execution time was 1352.91 ms.ms # where query<br />
63.67 1 pager_query SELECT url, COUNT(url) AS hits, MAX(timestamp) AS<br />
last FROM accesslog WHERE url NOT LIKE &#8216;%www.morazzia.com%&#8217; AND url<br />
&lt;&gt; &#8221; GROUP BY url ORDER BY hits DESC LIMIT 0, 30<br />
1.08 1 forum_block SELECT n.nid, n.title, l.comment_count FROM node n<br />
INNER JOIN node_comment_statistics l ON n.nid = l.nid WHERE n.type =<br />
&#8216;forum&#8217; AND n.status = 1 ORDER BY n.nid DESC LIMIT 0, 5<br />
0.92	1	user_block	SELECT COUNT(sid) AS count FROM sessions WHERE timestamp &gt;= 1167293169 AND uid = 0<br />
0.89 1 module_list SELECT name, filename, throttle, bootstrap FROM<br />
system WHERE type = &#8216;module&#8217; AND status = 1 ORDER BY weight ASC,<br />
filename ASC<br />
0.87	1	drupal_lookup_path	SELECT dst FROM url_alias WHERE src = &#8216;http://www.baberoad.com/&#8217;<br />
0.65	1	cache_get	SELECT data, created, headers, expire FROM cache WHERE cid = &#8216;menu:1:en&#8217;<br />
0.63	1	pager_query	SELECT COUNT(DISTINCT(url)) FROM accesslog WHERE url &lt;&gt; &#8221; AND url NOT LIKE &#8216;%www.morazzia.com%&#8217;<br />
0.58	1	block_list	SELECT * FROM blocks WHERE theme = &#8216;morazzia&#8217; AND status = 1 ORDER BY region, weight, module</em></p>
<p>Here you can see my php info page: <a href="http://www.morazzia.com/phpinfo.php" title="http://www.morazzia.com/phpinfo.php" rel="nofollow">http://www.morazzia.com/phpinfo.php</a></p>
<p>Any advice?</p>
<p>Regards,<br />
Rale</p>
</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.doyourself.org/mysql/552-mysql-query-out-of-memory-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

