Krishna
Krishna

Reputation: 21

propel-schema-reverse error : could not find driver

Just started working with php and propel.

I am using Uniform Server (wamp server) and have db in mysql.

I am getting following error while running 'propel-gen test reverse'

propel > reverse:

[echo] +-----------------------------------------------+
[echo] | |
[echo] | Generating XML from PDO connection ! |
[echo] | |
[echo] +-----------------------------------------------+
[propel-schema-reverse] There was an error building XML from metadata: could not find driver

BUILD FINISHED

even error is not so much elaborated.

here is my build.properties

propel.home = .

propel.project = test

propel.targetPackage = lib.model

propel.packageObjectModel = true

propel.database = mysql

propel.database.driver = mysql

propel.database.url = mysql:host=localhost;dbname=db_test

propel.database.user = myuser

propel.database.password = mypwd

please tell me how to resolve this problem and view description of the error.

thanks in advance.

Upvotes: 2

Views: 2441

Answers (3)

gdm
gdm

Reputation: 7978

You have to correct the url or dns. For example, in my database.yml (I am using Propel under Symfony) you have to put someting like this:

all:
  propel:
    class: sfPropelDatabase
    param:
      classname: PropelPDO
      **dsn: 'mysql:host=localhost;dbname=sfjob'**
      username: root
      password: miyoko
      encoding: utf8
      persistent: true
      pooling: true

The important thing is the url: should be mysql and not msql

Upvotes: 1

Sergey Naumov
Sergey Naumov

Reputation: 11

You should enable add line below to php-cli.ini to solve this problem

extension=php_pdo_mysql.dll

Upvotes: 1

cristobal
cristobal

Reputation: 462

Hmm try changing

propel.data.driver = mysql

To

propel.data.driver = mysqli

If it still does not work it may seem that WAMP does not ship with php PDO drivers. Dunno i don't use WAMP but an alternative could be XAMP

Upvotes: 0

Related Questions