Ask your Symfony questions! Pay money and get answers fast! (more info)

Propel Exception: No connection params set for propel Symfony

  • SOLVED

Symfony version 1.0.20.

I am getting the following error:


[PropelException]
No connection params set for propel

stack trace
at ()
in SF_SYMFONY_LIB_DIR/vendor/propel/Propel.php line 476 ...

$dsn = isset(self::$configuration['datasources'][$name]['connection']) ? self::$configuration['datasources'][$name]['connection'] : null;

if ($dsn === null) {

throw new PropelException("No connection params set for " . $name);

}


include_once 'creole/Creole.php';
at Propel::getConnection('propel')
in SF_ROOT_DIR/lib/model/om/BaseZorMicrosoftContentPeer.php line 202 ...
at BaseZorMicrosoftContentPeer::doSelectRS(object('Criteria'), null)
in SF_ROOT_DIR/lib/model/om/BaseZorMicrosoftContentPeer.php line 196 ...
at BaseZorMicrosoftContentPeer::doSelect(object('Criteria'))
in SF_ROOT_DIR/apps/cms/modules/zor/actions/actions.class.php line 27 ...
at zorActions->executeCourses()
in SF_SYMFONY_LIB_DIR/action/sfActions.class.php line 53 ...
at sfActions->execute()
in SF_SYMFONY_LIB_DIR/filter/sfExecutionFilter.class.php line 129 ...




I have this as my top level config/database.yml:

all:
propel:
class: sfPropelDatabase
param:
hostspec: localhost
database: zor
username: autos
password: zzz




I've checked these credentials. I can log into this database from the command line, using these credentials.

I've run "symfony cc". I've rebuilt the model classes.

What am I missing?





Answers (4)

2010-04-06

Arturo Linares answers:

try adding the dsn key, like (in this case I'm using postgres –the pgsql part–):


all:
propel:
class: sfPropelDatabase
param:
dsn: pgsql://autos:[email protected]/zor
encoding: utf8 # Default charset for table creation
persistent: false # Use persistent connections

2010-04-06

Martin Palacio answers:

Did you mean "databases.yml" right? (note the last 's' on file name)

I was always comfortable with the DSN syntax instead of separated params.

[[LINK href="http://www.symfony-project.org/book/1_0/08-Inside-the-Model-Layer#chapter_08_database_connections"]]Look here[[/LINK]], at listing 8-18.

Also check file permissions, location, and syntax (ex. extra spaces).

2010-04-06

casivaagustin answers:

You miss the DSN, if you use MySQL try with this command<br />
php symfony configure:database "mysql:host=localhost;dbname=zor" autos zzz

2010-04-06

Gert Findel answers:

databases.yml


all:
propel:
class: sfPropelDatabase
param:
dsn: 'mysql:host=localhost;dbname=zor'
username: autos
password: zzz