This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

PropelException No connection params (again!!)

Discussion around this tutorial for symfony 1.0.x

PropelException No connection params (again!!)

by trax » Wed Feb 21, 2007 2:43 am

I know this topic is explained very often but believe me, I did not get it.

The last 6 hours I've read all topics and tried everything.

I used the schmema.xml from the svn repository (http://svn.askeet.com/tags/release_1_0/config/schema.xml).

My database.yml:

Code: Select all

all:
  propel:
    class:      sfPropelDatabase
    param:
      phptype:  mysql
      host: localhost
      database: ask
      username: root
      password: 1111



My propel.ini

Code: Select all
propel.targetPackage       = lib.model
propel.packageObjectModel  = true
propel.project             = ask
propel.database            = mysql
propel.database.createUrl  = mysql://localhost/
propel.database.url        = mysql://localhost/ask

propel.addGenericAccessors = true
propel.addGenericMutators  = true
propel.addTimeStamp        = false

propel.schema.validate     = false

; directories
propel.home                    = .
propel.output.dir              = /var/www/sf/askeet24
propel.schema.dir              = ${propel.output.dir}/config
propel.conf.dir                = ${propel.output.dir}/config
propel.phpconf.dir             = ${propel.output.dir}/config
propel.sql.dir                 = ${propel.output.dir}/data/sql
propel.runtime.conf.file       = runtime-conf.xml
propel.php.dir                 = ${propel.output.dir}
propel.default.schema.basename = schema
propel.datadump.mapper.from    = *schema.xml
propel.datadump.mapper.to      = *data.xml

; builder settings
propel.builder.peer.class              = addon.propel.builder.SfPeerBuilder
propel.builder.object.class            = addon.propel.builder.SfObjectBuilder

propel.builder.objectstub.class        = addon.propel.builder.SfExtensionObjectBuilder
propel.builder.peerstub.class          = addon.propel.builder.SfExtensionPeerBuilder
propel.builder.objectmultiextend.class = addon.propel.builder.SfMultiExtendObjectBuilder
propel.builder.mapbuilder.class        = addon.propel.builder.SfMapBuilderBuilder
propel.builder.interface.class         = propel.engine.builder.om.php5.PHP5InterfaceBuilder
propel.builder.node.class              = propel.engine.builder.om.php5.PHP5NodeBuilder
propel.builder.nodepeer.class          = propel.engine.builder.om.php5.PHP5NodePeerBuilder
propel.builder.nodestub.class          = propel.engine.builder.om.php5.PHP5ExtensionNodeBuilder
propel.builder.nodepeerstub.class      = propel.engine.builder.om.php5.PHP5ExtensionNodePeerBuilder

propel.builder.addIncludes = false
propel.builder.addComments = false

propel.builder.addBehaviors = false


My config_databases.yml.php:

Code: Select all
<?php
// auto-generated by sfDatabaseConfigHandler
// date: 2007/02/21 01:29:41

$database = new sfPropelDatabase();
$database->initialize(array (
  'phptype' => 'mysql',
  'host' => 'localhost',
  'database' => 'ask',
  'username' => 'root',
  'password' => '1111',
), 'propel');
$this->databases['propel'] = $database;


The Database ask exists.

I run:
Code: Select all
symfony propel-build-model
symfony propel-build-sql
mysql -u root -p ask< data/sql/schema.sql
symfony cc
symfony propel-generate-crud frontend question Question



All the tables in the database are successfully created.

But everytime, there is this error:

Code: Select all

[PropelException]
No connection params set for symfony
stack trace
at ()
in SF_ROOT_DIR/lib/symfony/vendor/propel/Propel.php line 471 ...


            $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';
trax
Junior Member
 
Posts: 8
Joined: Mon Feb 19, 2007 1:35 pm

Re: PropelException No connection params (again!!)

by aruban » Wed Feb 21, 2007 3:12 am

in propel.ini, try to change

Code: Select all
propel.database.createUrl  = mysql://localhost/
propel.database.url        = mysql://localhost/ask


by

Code: Select all
propel.database.createUrl  = mysql://root:1111@localhost/
propel.database.url        = mysql://root:1111@localhost/ask
aruban
Member
 
Posts: 70
Joined: Mon Oct 16, 2006 2:56 am
Location: yokohama

Re: PropelException No connection params (again!!)

by trax » Wed Feb 21, 2007 10:47 am

Unfortunatly not the solution.

:cry:
trax
Junior Member
 
Posts: 8
Joined: Mon Feb 19, 2007 1:35 pm

Re: PropelException No connection params (again!!)

by trax » Thu Feb 22, 2007 10:38 pm

Any other ideas?

Please! I'd like to work on my project so much!
trax
Junior Member
 
Posts: 8
Joined: Mon Feb 19, 2007 1:35 pm

Re: PropelException No connection params (again!!)

by aruban » Fri Feb 23, 2007 1:16 am

no reals ideas, sorry...
Maybe, just try to change
Code: Select all
all:
  propel:
    class:      sfPropelDatabase
    param:
      phptype:  mysql
      host: localhost
      database: ask
      username: root
      password: 1111

by
Code: Select all
all:
  propel:
    class:      sfPropelDatabase
    param:      mysql://root:1111@localhost/ask

it's the syntax i always use, it's working fine...

Can you tell us more about your config... OS, PHP version, IDE... ?

Another thing is, maybe, you are not editing the right files...
I had a similar problem yesterday ! Using Eclipse for the first time... and loose 30 minutes to realise that eclipse import file by copy them in a new folder and not by editing the ones in the folder you specify...
aruban
Member
 
Posts: 70
Joined: Mon Oct 16, 2006 2:56 am
Location: yokohama

Re: PropelException No connection params (again!!)

by trax » Fri Feb 23, 2007 1:24 am

I could install the sand_box - no problems.

I created a new sf-project - no problems.

Only in this case.
Unfortunatly the changes in the propel.ini did not work.

My OS:

Linux debian 2.4.27-3-386
PHP 5.2.0-8


The hint with the right files could be right because the changed the structure of symfony within the last RCs.

Thanx!!
trax
Junior Member
 
Posts: 8
Joined: Mon Feb 19, 2007 1:35 pm

Re: PropelException No connection params (again!!)

by netelk » Tue Feb 27, 2007 12:46 am

I've searched the last 4 hours about the same topic :evil: , and for me, it's so simple - now :D~ :-D~ :grin: :

in the schema.xml the name of the database HAS TO BE propel, whatever the real database name is or will be (as mentioned in the tutorial - I think, I've read 20 times..... what a :oops :).

After rebuilding propel-model everything works fine - hope it helps someone else, too!

Good Night!
netelk
Junior Member
 
Posts: 1
Joined: Tue Feb 27, 2007 12:38 am

Re: PropelException No connection params (again!!)

by musikman » Wed Feb 28, 2007 8:00 pm

Hi! i Found the solution.
(database.yml)
all:
yourdatabasename: #instead of propel, put your database name here
class: sfPropelDatabase
param:
dsn: mysql://root:@localhost/yourdatabasename

After that! clear your symfony cache (symfony cc) and refresh your browser with the shift key! It will work!

Francois
musikman
Junior Member
 
Posts: 13
Joined: Wed Feb 28, 2007 7:47 pm
Location: Vancouver, BC Canada

Re: PropelException No connection params (again!!)

by IOOI » Sat Mar 03, 2007 3:31 am

@Trax, i was in ths same pitfall, and netelk's workaround works, thanks netelk! :)~ :-)~ :smile:
IOOI
Junior Member
 
Posts: 14
Joined: Fri Jul 28, 2006 12:55 pm
Location: Beijing

Re: PropelException No connection params (again!!)

by halfer » Mon Mar 05, 2007 5:19 pm

in the schema.xml the name of the database HAS TO BE propel

Not quite. The name in the schema has to be the same as the 'datasource' in the database connection settings. This is set by default to 'propel', hence the apparent requirement to use this name.
halfer
Faithful Member
 
Posts: 10148
Joined: Mon Jan 30, 2006 1:16 pm
Location: West Midlands, UK

Re: PropelException No connection params (again!!)

by IOOI » Wed Mar 07, 2007 5:42 am

good point, halfer!
IOOI
Junior Member
 
Posts: 14
Joined: Fri Jul 28, 2006 12:55 pm
Location: Beijing

Re: PropelException No connection params (again!!)

by trax » Wed Mar 07, 2007 5:54 pm

Thank you all for your support!!
trax
Junior Member
 
Posts: 8
Joined: Mon Feb 19, 2007 1:35 pm

Re: PropelException No connection params (again!!)

by postman » Wed May 09, 2007 11:34 am

Hello!

I had the same problem, and my solution is to edit database.yml in such way:

all:
symfony:
class: sfPropelDatabase
param:
dsn: mysql://root:@localhost/askeet

In second line you should type the name of connection, and according to the error message it is "symfony".

I hope this will help somebody.
postman
Member
 
Posts: 77
Joined: Thu Jun 22, 2006 4:22 pm

Re: PropelException No connection params (again!!)

by rschumacher » Sun Aug 26, 2007 10:49 am

netelk wrote:
in the schema.xml the name of the database HAS TO BE propel, whatever the real database name is or will be (as mentioned in the tutorial - I think, I've read 20 times..... what a :oops :).


This resolved the (same) problem I experienced myself.
Thanks f.y. help!

RAPHAEL
User avatar
rschumacher
Faithful Member
 
Posts: 231
Joined: Wed Aug 15, 2007 3:28 pm
Location: Basel, Switzerland

Re: PropelException No connection params (again!!)

by javacrazy » Mon Dec 10, 2007 11:14 pm

This solved the problem.

Note:
Be aware of the identation. Also, use space instead of tabs for indentation.

=== database.yml ===
all:
propel:
class: sfPropelDatabase
param:
dsn: mysql://<username>:<password>@localhost/<tablename>
javacrazy
Junior Member
 
Posts: 4
Joined: Mon Dec 10, 2007 11:10 pm

Re: PropelException No connection params (again!!)

by swellbow » Tue Mar 25, 2008 6:12 am

Thank you all so much. I searched everywhere :roll: and finally found the answer here. :D~ :-D~ :grin: Yinz rock!
swellbow
Junior Member
 
Posts: 1
Joined: Tue Mar 25, 2008 6:10 am

Re: PropelException No connection params (again!!)

by tarun » Mon Aug 25, 2008 12:49 pm

hi,
I was also having same problem. and the solution given helps me a lot. Thanks to save my hours of hard word.
Regards,
Tarun Kumar,
http://www.izap.in
tarun
Junior Member
 
Posts: 7
Joined: Mon Jun 30, 2008 12:28 am
Location: Ludhiana