Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQLSTATE[HY000] [2002] Not a directory when doctrine:schema:create

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!

like image 746
xanesis4 Avatar asked Dec 24 '13 03:12

xanesis4


1 Answers

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
like image 173
raygo Avatar answered Oct 10 '22 06:10

raygo