开发者

"No such file or directory" SQLSTATE error using PHPUnit with XAMPP & Zend Framework

开发者 https://www.devze.com 2023-01-03 15:53 出处:网络
The error I\'m getting is below. 开发者_JS百科 Zend_Db_Adapter_Exception: SQLSTATE[HY000] [2002] No such file or directory

The error I'm getting is below.

开发者_JS百科
Zend_Db_Adapter_Exception: SQLSTATE[HY000] [2002] No such file or directory

I've tried setting the xampp php to be the php in my PATH, hoping that it's a configuration file, but I had no luck with that. I'm not really sure why else it would say no such file or directory. Does anyone have any ideas?

Update: I also looked into the php.ini file that's being called (as taken from php -i), and set the default socket to equal XAMPP's mysql.sock file, and still the same error.


That was fun. I had to add the following entry into the options array from MySQL.

'unix_socket' => '/Applications/XAMPP/xamppfiles/var/mysql/mysql.sock',

I found it by (this is ugly) going into the Zend/Db/Adapter/Pdo/Abstract.php and having it print_r the exception. From there, I found it was trying to connect to /tmp/mysql.sock (Anyone know why?)

0

精彩评论

暂无评论...
验证码 换一张
取 消