views:

164

answers:

1

I am having issues getting my database to build from my YAML file.

Here is the error:

./scripts/doctrine-cli build-all-load
build-all-load - Generated models successfully from YAML schema
build-all-load - Couldn't locate driver named mysql
build-all-load - Created tables successfully
build-all-load - Data was successfully loaded

It builds my models, but nothing in the database. I am using MAMP and I have checked and pdo_mysql is running. I am not completely sure why this would happen. Thank you.

A: 

This quite looks like pdo_mysql is not enabled ; you said you checked php.ini, but did you check the one that's used when PHP is run from the command line ?

(That's often not the same as the one used when PHP is run as an Apache module)


You can use php -m to get the list of loaded extensions :

$ php -m
[PHP Modules]
bcmath
bz2
...
pcre
PDO
pdo_mysql
...

And php -i should indicate which .ini file is used, when running PHP from the CLI :

$ php -i | grep 'ini'
Configuration File (php.ini) Path => /etc/php5/cli
Loaded Configuration File => /etc/php5/cli/php.ini
Scan this dir for additional .ini files => /etc/php5/cli/conf.d
additional .ini files parsed => /etc/php5/cli/conf.d/apc.ini,
/etc/php5/cli/conf.d/curl.ini,
...
Pascal MARTIN
PHP from the command line was using the Mac default, I changed it over to the MAMP version. But still no tables created...Now I get this message when it creates them, "Successfully created database for connection named '0'"
gokujou
OK for the php.ini problem : that's good news ;;; for the problem you are now experiencing : are you sure the doctrine task you are using is actually supposed to create the tables ? (just a question ) seems odd it said "created tables successfully" earlier, and doesn't anymore
Pascal MARTIN
Oh it still says that too. I just copied the new line, sorry.
gokujou
Corrected it, I had a model in there from my prototype version and Doctrine didn't like it. Now it all works great, thank you!
gokujou