I'm currently programming in Symfony2 (following this tutorial: tutorial.symblog.co.uk, and when I execute a:
我目前正在使用Symfony2进行编程(遵循本教程:tutorial.symblog.co.uk,当我执行:
php app/console doctrine:schema:create
I get:
我明白了:
[PDOException]
SQLSTATE[HY000] [2002] Not a directory
Here is my parameters.yml file:
这是我的parameters.yml文件:
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.
如你所见,我正在使用MAMP,我的phpMyAdmin能够连接,其他一切都很好。请帮忙。
Thanks in advance!
提前致谢!
1 个解决方案
#1
13
Create symlink from local mysql.sock to MAMP:
从本地mysql.sock创建符号链接到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
#1
13
Create symlink from local mysql.sock to MAMP:
从本地mysql.sock创建符号链接到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