ds122455 2014-07-20 06:31
浏览 169
已采纳

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

I'm new in Symfony2 and I'm following the jobeet tutorials. I'm in day-2 and I'm trying to create a database using

php app/console doctrine:database:create

this command, and I'm getting

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

Here is my parameters.yml file

# 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

And here is my config.yml file

# 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条回答 默认 最新

  • dongmi4927 2014-07-20 15:48
    关注

    try with :

    database_driver: pdo_mysql
    database_host: localhost
    database_port: null
    database_name: jobeet
    database_user: mergenc
    database_password: password
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥50 mac mini外接显示器 画质字体模糊
  • ¥15 TLS1.2协议通信解密
  • ¥40 图书信息管理系统程序编写
  • ¥20 Qcustomplot缩小曲线形状问题
  • ¥15 企业资源规划ERP沙盘模拟
  • ¥15 树莓派控制机械臂传输命令报错,显示摄像头不存在
  • ¥15 前端echarts坐标轴问题
  • ¥15 ad5933的I2C
  • ¥15 请问RTX4060的笔记本电脑可以训练yolov5模型吗?
  • ¥15 数学建模求思路及代码