문제

The error I'm getting is below.

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?)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top