Propel:myproject数据库没有可用的连接

时间:2014-06-18 12:05:13

标签: php propel

我在做

时遇到错误
$ ./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

我错过了什么?

谢谢。

1 个答案:

答案 0 :(得分:1)

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

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

buildtime-conf.xml runtime-conf.xml 非常相似,因此您只需复制,重命名并查看其是否有效。