Symfony2 - doctrine:schema:为用户创建拒绝访问权限

时间:2012-06-18 08:47:34

标签: mysql symfony doctrine localhost

/app/config/parameters.ini

[parameters]
    database_driver   = pdo_mysql
    database_host     = localhost
    database_port     =
    database_name     = my_dbname
    database_user     = my_user
    database_password = my_password

Linux shell

/var/www/Symfony$ mysql -u my_user -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
...
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| my_dbname          |
| test               |
+--------------------+

mysql> Bye
/var/www/Symfony$ php app/console doctrine:schema:create

[PDOException]                                                               
SQLSTATE[28000] [1045] Access denied for user 'my_user'@'localhost' (using pa  
ssword: YES)

可能导致问题的原因是什么?

1 个答案:

答案 0 :(得分:0)

我的密码包含@字符,这就是问题所在。