我的项目数据库没有可用的连接


Propel: No connection available for myproject database

在执行

操作时出现错误
$ ./propel model:build --verbose
Processing: schema.xml
  1 tables processed successfully
1 tables found in 1 schema files.
Generating PHP files...
Datamodel: ./schema.xml
 - Database: myproject
  + Table: resource
        -> (unchanged) /Base/Resource.php
        -> (unchanged) /Map/ResourceTableMap.php
        -> (unchanged) /Base/ResourceQuery.php
        -> (exists) Resource.php
        -> (exists) ResourceQuery.php
                (no change)
Object model generation complete - All files already up to date
$ ./propel sql:build --verbose
Processing: schema.xml
  1 tables processed successfully
1 tables found in 1 schema files.
$ ./propel sql:insert --verbose
No connection available for myproject database
$

输出为:

No connection available for myproject database

以下是我感兴趣的3个文件:

的build . properties

runtime-conf.xml

schema.xml

我错过了什么?

谢谢。

您可能在build.properties中缺少这些:

propel.runtime.conf.file   = runtime-conf.xml
propel.buildtime.conf.file = buildtime-conf.xml

你的buildtime-conf.xml非常类似于你的runtime-conf.xml,所以你可以复制,重命名,看看它是否工作。