SQLSTATE [28000] [1045]用户'root'@'localhost'的访问被拒绝(使用密码:是)Symfony2 [英] SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: YES) Symfony2

查看:521
本文介绍了SQLSTATE [28000] [1045]用户'root'@'localhost'的访问被拒绝(使用密码:是)Symfony2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用下面的命令使用Symfony2创建数据库:

I tried to create my DB with Symfony2 typing the command below:

php app/console doctrine:create:database

结果是:

无法为名为jobeet的连接创建数据库 SQLSTATE [28000] [1045]用户'root'@'localhost'的访问被拒绝(使用密码:是)

Could not create database for connection named jobeet SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: 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.

My OS is Ubuntu.

我不知道该怎么办才能解决此问题.

I don't know what to do to correct this problem.

推荐答案

尝试使用以下命令通过终端登录:

Try to login via the terminal using the following command:

mysql -u root -p

然后将提示您输入密码.如果失败,则肯定是用户名或密码不正确.如果可行,那么您的数据库密码需要用引号引起来:

It will then prompt for your password. If this fails, then definitely the username or password is incorrect. If this works, then your database's password needs to be enclosed in quotes:

database_password: "0000"

这篇关于SQLSTATE [28000] [1045]用户'root'@'localhost'的访问被拒绝(使用密码:是)Symfony2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆