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"