[英]Why can't I connect to the Database with symfony's propel ORM?
I'm building the blog project example shown in the "definitive guide of symfony" (chapter 8: the model) on official webpage.我正在构建官方网页上“symfony权威指南”(第8章:模型)中显示的博客项目示例。 When i do operations that affects the database (like save();) in symfony, this message appears:
当我在 symfony 中执行影响数据库的操作(如 save();) 时,会出现以下消息:
Unable to open PDO connection [wrapped: SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: NO)]
无法打开 PDO 连接 [wrapped: SQLSTATE [28000] [1045] 用户'root'@'localhost'的访问被拒绝(使用密码:否)]
I tried to find errors in propel configuration files and nothing found.我试图在推进配置文件中查找错误,但没有找到。 I just did what the guide says, nothing else.
我只是按照导游说的做,没有别的。 Maybe i need to create by command line the database or something like.
也许我需要通过命令行创建数据库或类似的东西。
You need to properly configure databases.yml with a valid user and password for your MySQL server.您需要使用 MySQL 服务器的有效用户和密码正确配置 databases.yml。 Right now it's trying to connect as the root user with no password, and it appears that's not valid for your local MySQL configuration.
现在它正在尝试以没有密码的 root 用户身份连接,并且它似乎对您的本地 MySQL 配置无效。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.