<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://jackxiang.com/post//</link>
<title><![CDATA[PHP on OSX: Cant connect to local MySQL server through socket /var/mysql/mysql.sock]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[WEB2.0]]></category>
<pubDate>Thu, 30 Dec 2010 11:49:54 +0000</pubDate> 
<guid>http://jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	When installing PHP and MySQL on OSX&nbsp;&nbsp;you may get the error Can’t connect to local MySQL server through socket ‘/var/mysql/mysql.sock’.&nbsp;&nbsp;Or you may also get “No such file or directory” when calling mysql_connect from a PHP page.&nbsp;&nbsp;This occurs because PHP is looking for the file mysql.sock in it’s typical installation location of /var/mysql/mysql.sock. However the MySQL OSX installer actually puts the file in /tmp/mysql.sock. There are two easy ways to solve the problem.<br/><br/><br/>Solution 1: Create a symbolic link<br/><br/>Open terminal and do the following:<br/><br/>sudo su<br/>mkdir /var/mysql<br/>ln -s /tmp/mysql.sock /var/mysql/mysql.sock<br/><br/>You just created a symbolic link in the place where PHP expects the socket file to be located so it should be happy.<br/><br/>Solution 2: Edit php.ini<br/><br/>If you don’t like the idea of creating a symbolic link, you can also simply alter your php.ini file to point PHP to the real location of mysql.sock.<br/><br/>Locate /etc/php.ini. (If php.ini doesn’t exist on your system, copy /etc/php.ini.default to /etc/php.ini).&nbsp;&nbsp;You will likely have to do this from the terminal unless you have Finder configured to show hidden files.&nbsp;&nbsp;Open the file and update the setting mysql.default_socket so it looks like this:<br/><br/>mysql.default_socket = /tmp/mysql.sock<br/><br/>To commit the change you need to restart Apache.&nbsp;&nbsp;You can do that in System Settings -&gt; Sharing, then&nbsp;&nbsp;uncheck, then recheck Web Sharing.<br/><br/><br/><br/>注解：这个问题，在php和Mysql一台及其的时候特别需要注意，否则mysql没法连接上，而php -m&#124;grep mysql&nbsp;&nbsp;是有的，无法排查，而在链接其他IP机器是没有该问题的，注意下。<br/><br/>来源：http://verysimple.com/2009/01/07/php-on-os-cant-connect-to-local-mysql-server-through-socket-varmysqlmysqlsock/
]]>
</description>
</item><item>
<link>http://jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] PHP on OSX: Cant connect to local MySQL server through socket /var/mysql/mysql.sock]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>