0

On Mac OS (snow leopard) I have a SSH tunnel so that my local 3306 port is forwarded to remote MySQL. Apps like Navicat can establish connection successfuly.

But PHP's PDO can't connect and gives an error:

PDO::__construct(): [2002] No such file or directory (trying to connect via unix:///tmp/mysql.sock) 

What should I do?

1 Answer 1

0

check this:

https://stackoverflow.com/questions/1819592/error-when-connecting-to-mysql-using-php-pdo

You have to use tcp/ip, not sockets. Try 127.0.0.1 instead of 'localhost'.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .