symfony/symfony — Issue #2571: SQLSTATE[42000] [1049] Unknown database  PDOException
Author: barryj
Created: 2011-11-06 08:10:11+00:00
State: open

Hi guys

I have been following the section in THE BOOK called "Databases and Doctrine (The Model)" which has an example that you can code along with ( http://symfony.com/doc/2.0/book/doctrine.html ) but I get the following error message:

SQLSTATE[42000] [1049] Unknown database 'test_project'
500 Internal Server Error - PDOException

At first I thought there was a problem with mysql so I uninstalled and re-installed it, but it made no difference.

When I run the command: php app/console doctrine:database:create

I get the following:

Could not create database for connection named test_project
SQLSTATE[HY000]: General error: 1007 Can't create database 'test_project'; database exists

So it looks like the database has been created, although I cannot find which directory it is in!

And when I run the command: php app/console doctrine:schema:update --force

it says:

Nothing to update - your database is already in sync with the current entity metadata.

Please help!!

Thanks in advance

Barry