19
2月
2013

Mac OS 使用thinkphp后,数据库无法连接 No such file or directory DbMysql.class.php 214

开发环境是php+mysql+nginx,全部通过macports安装,目录均在/opt/local/下

使用thinkphp连接链接数据库时(实例化数据模型时)报错:

../Lib/Driver/Db/DbMysql.class.php LINE:214

No such file or directory

 

发现/tmp/目录下的mysql.sock文件消失

解决方法:

做软连接:

ln -s /opt/local/var/run/mysql5/mysqld.sock /tmp/mysql.sock

 

You may also like...