简体   繁体   English

为什么我用symfony的propel ORM连接不上数据库?

[英]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.

相关问题 为什么我不能使用propel orm在symfony中构建我的数据库。 - Why Can't i build my database in symfony using propel orm.? 在Symfony 1.2中,如何从Propel的database.yml文件中获取当前数据库名称? - In Symfony 1.2 how can I get the current database name from the database.yml file in Propel? 当字段值包含/或\\时,Propel ORM无法过滤 - Propel ORM can't filterBy when field value contains / or \ 无法使用symfony连接到PostgreSQL数据库 - Can't connect to PostgreSQL database with symfony 为什么我不能连接到新创建的数据库? - Why can't I connect to newly created database? 我无法连接到数据库 - I can't connect to database 最初,我连接到phonegap的数据库,但是当我移到第二个html页面时,我无法连接 - Initially i connect to phonegap's database but when i move to the second html page i can;t connect 为什么我无法连接到我的sql数据库? 我收到错误消息:“无法通过套接字连接到本地MySQL服务器” - Why can't I connect to my sql database? I get the error message: “Can't connect to local MySQL server through socket” 为什么我不能使用 DB Manager 连接到 ElevateDB 数据库(所以我可以导出表)? - Why can't I connect to ElevateDB database using DB Manager (so I can export tables)? 我无法在Symfony 1.0中连接MySQL DB - I can't connect MySQL DB in symfony 1.0
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM