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

1

8

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!

Ricky answered 24/12, 2013 at 3:26 Comment(3)
IT's a problem with the socket probably.Subcontract
Raygo, how could I fix that? And is there a file I could show you that would help you diagnose this? Thanks in advance!Ricky
Try modifying the database_host from "localhost" to "127.0.0.1"Subcontract
S
13

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
Subcontract answered 24/12, 2013 at 4:36 Comment(2)
Thanks man! This worked perfectly! This was quite a rookie mistake on my part... Sorry to trouble you!Ricky
No trouble! Glad it helped!Subcontract

© 2022 - 2024 — McMap. All rights reserved.