无法创建数据库SQLSTATE [HY000] [1045]为Symfony创建数据库时出错

时间:2014-07-20 06:31:54

标签: php symfony

我是Symfony2的新手,我正在关注这个招聘教程。我在第2天,我正在尝试使用

创建数据库
php app/console doctrine:database:create

这个命令,我正在

Could not create database for connection named `jobeet`
SQLSTATE[HY000] [1045] Access denied for user 'mergenc'@'localhost' (using password: YES)

这是我的parameters.yml文件

# This file is auto-generated during the composer install
parameters:
database_driver: pdo_mysql
database_host: localhost
database_port: 3306
database_name: jobeet
database_user: mergenc
database_password: 'password'
mailer_transport: smtp
mailer_host: 127.0.0.1
mailer_user: null
mailer_password: null
locale: en
secret: ThisTokenIsNotSoSecretChangeIt
debug_toolbar: true
debug_redirects: false
use_assetic_controller: true

这是我的config.yml文件

# Doctrine Configuration
doctrine:
dbal:
    driver:   "%database_driver%"
    host:     "%database_host%"
    port:     "%database_port%"
    dbname:   "%database_name%"
    user:     "%database_user%"
    password: "%database_password%"
    charset:  UTF8
    # if using pdo_sqlite as your database driver, add the path in parameters.yml
    # e.g. database_path: "%kernel.root_dir%/data/data.db3"
    # path:     "%database_path%"

orm:
    auto_generate_proxy_classes: "%kernel.debug%"
    auto_mapping: true

2 个答案:

答案 0 :(得分:0)

你是否在mysql服务器上创建了用户'mergenc'?他有行政权吗?

您确定您的密码是mergenc的“密码”

答案 1 :(得分:0)

尝试:

database_driver: pdo_mysql
database_host: localhost
database_port: null
database_name: jobeet
database_user: mergenc
database_password: password