I am experiencing some very odd behavior with my Symfony2 application using Doctrine with PDO_mysql:
After cloning it from repository, I need to install it via composer, without the database being already created. I want to create the database later with
[PDOException] SQLSTATE  Unknown database 'test'
Created database `test` for connection named default
I called some of the problematic commands with verbose and I came up with an exception trace, containing this:
Doctrine\DBAL\Schema\AbstractSchemaManager->tablesExist() at vendor/lexik/translation-bundle/Lexik/Bundle/TranslationBundle/Storage/DoctrineORMStorage.php:28 Lexik\Bundle\TranslationBundle\Storage\DoctrineORMStorage->translationsTablesExist() at vendor/lexik/translation-bundle/Lexik/Bundle/TranslationBundle/EventDispatcher/GetDatabaseResourcesListener.php:41
So I checked LexikTranslationBundle and found this issue, fixed by this commit. Unfortunately for me, the fix is only merged into version 4, which requires Symfony 2.8. I proposed merging into other versions too, but in a meantime I ended up forking the bundle and fixing it for myself. Now everything works as expected.