Question

I'm currently programming in Symfony2 (following this tutorial: tutorial.symblog.co.uk, and when I execute a:

php app/console doctrine:schema:create

I get:

[PDOException]
SQLSTATE[HY000] [2002] Not a directory

Here is my parameters.yml file:

parameters:
    database_driver: pdo_mysql
    database_host: localhost
    database_port: '3306'
    database_name: symblog
    database_user: root
    database_password: ~
    database_path: /Applications/MAMP/tmp/mysql/mysql.sock
    mailer_transport: gmail
    mailer_host: smtp.gmail.com
    mailer_user: ~
    mailer_password: ~
    locale: en
    secret: ~

I know the username and password are correct for the database, and for the mailer.

As you can see, I'm using MAMP, and my phpMyAdmin is able to connect, and everything else is fine. Please help.

Thanks in advance!

Was it helpful?

Solution

Create symlink from local mysql.sock to MAMP:

sudo mkdir /var/mysql
sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /var/mysql/mysql.sock
sudo chown _mysql /var/mysql/mysql.sock
sudo chmod 777 /var/mysql/mysql.sock
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top