Tuesday 30 December 2008

symfony - upgrade1.2 and Propel 1.3 DSN

Yup, I have been fiddling around with symfony some more!
Since I installed the latest stable build of symfony (1.2.1), I decide to upgrade my projects using:

symfony project:upgrade1.2

The command processed fine but then all hell broke loose so to speak. Basically, the whole project went kaput. So...
I then ran the magic (that is in the non-PHP sense) command:

symfony plugin:publish-assets

Which fixed all my sfGuardPlugin issues!

My next problem was related to propel. I had my databases.yml file configured like so:

all:
propel:
class: sfPropelDatabase
param:
phptype: mysql
database: anxcity
dsn: 'mysql://root@localhost/anxcity'

I kept getting an Access denied error for user 'ODBC' which was strange since my DSN contained the user: root.

So... I tried the long form of the databases.yml declaration like so:

all:
propel:
class: sfPropelDatabase
param:
phptype: mysql
hostspec: localhost
database: anxcity
username: root
port: 3306
encoding: utf8
persistent: true

Then the system complained it wasn't receving the DSN string as planned.
So... I just added it:

dsn: mysql:dbname=anxcity;user=root;host=localhost;port=3306

That seems really trivial BUT ... you do need to use the exact string syntax for it to actually work (which is very different to the DSN string in my original configuration file).
And hey presto!

Thoughts?

Edit:
Ah yes, forgot to say I had to rebuild the model too, using:

symfony propel:build-model

No comments:

Online Marketing
Add blog to our blog directory blog search directory Blog Directory Blogarama - The Blog Directory