Troubleshooting "No such file or directory" when running `php app/console doctrine:schema:create`

Too late but I hope it can help someone.

Just today I fall into a similar situation (but in other context, I was trying to create entities from db).

I solved it simply modifying de database_host from "localhost" to "127.0.0.1" in the parameters.ini file.

I think my Mysql instance is running only via TCP and not socket and because this when use database_host="localhost" it fails.


Try to add this line

unix_socket: /tmp/mysql.sock

into your config.yml file > doctrine > dbal just after the password line.


I changed 'host'=> 'localhost' to 'host'=> '127.0.0.1' on app/config/database.php and everything is working correctly