men*_*aga 12 mysql ubuntu symfony
我尝试用Symfony2创建我的数据库,输入以下命令:
php app/console doctrine:create:database
结果是:
无法为名为
jobeetSQLSTATE的连接创建数据库[28000] [1045]用户"root"@"localhost"的访问被拒绝(使用密码:YES)
我的app/config/parameters.yml文件内容是:
parameters:
   database_driver:   pdo_mysql
   database_host:     127.0.0.1
   database_port:     ~
   database_name:     jobeet
   database_user:     root
   database_password: 0000
   mailer_transport:  smtp
   mailer_host:       127.0.0.1
   mailer_user:       ~
   mailer_password:   ~
   locale:            fr
   secret:            ThisTokenIsNotSoSecretChangeIt
我的操作系统是Ubuntu.
我不知道该怎么做才能解决这个问题.
Pie*_*eau 11
尝试使用以下命令通过终端登录:
mysql -u root -p
然后它会提示您输入密码.如果失败,那么用户名或密码肯定是不正确的.如果这样做,那么您的数据库的密码需要用引号括起来:
database_password: "0000"
我不知道究竟是什么原因,但我解决了运行中的问题:
   app/console cache:clear --env=prod
小智 5
在你的app/config/parameters.yml 
# This file is auto-generated during the composer install
parameters:
    database_driver: pdo_mysql
    database_host: 127.0.0.1
    database_port: 3306
    database_name: symfony
    database_user: root
    database_password: "your_password"
    mailer_transport: smtp
    mailer_host: 127.0.0.1
    mailer_user: null
    mailer_password: null
    locale: en
    secret: ThisTokenIsNotSoSecretChangeIt
的值database_password应位于双引号或单引号内,如:"your_password"或'your_password'。
我发现大多数用户都遇到此错误,因为他们使用的密码带有前导零或数字值。
| 归档时间: | 
 | 
| 查看次数: | 132149 次 | 
| 最近记录: |