How do I Connect to MySQL socket using Doctrine 1.2?
Following the directions at http://www.doctrine-project.org/projects/orm/1.2/docs/manual/introduction-to-connections/en#dsn,-the-data-source-name:examples, I get the following error
Message: PDO Connection Error: SQLSTATE[HY000] [2005] Unknown MySQL server host 'unix(' (1)
The exact DSN I am using is "mysql://root@unix(/tmp/mysql.sock)/test" Yes, root with no password via local unix socket.
This exact configuration works with phpMyAdmin, so I know the settings are valid. I've also tried with another user with password and got the same error.
What confuses me is why it's throwing the error a开发者_JS百科bout the host, when I'm trying connect via socket as the instructions provided.
Doctrine needs PDO-like query string, see if it matches yours:
http://www.php.net/manual/en/pdo.construct.php
Moreover, have a look at this:
Doctrine (in symfony project) can not connect through socket
精彩评论