I was faced with a similar issue and found that the command below
php vendor/bin/doctrine orm:schema-tool:create
Doesn't create the DB itself, it only creates the schema/tables.
I solved this by doing the following:
<?php
include 'bootstrap.php';
use Doctrine\ORM\Tools\Console\ConsoleRunner,
Doctrine\ORM\EntityManager;
try {
$entityManager->getConnection()->connect();
}
catch(Exception $ex) {
$connection = EntityManager::create([
'driver' => 'pdo_mysql',
'host' => MYSQL_HOST,
'user' => MYSQL_USERNAME,
'password' => MYSQL_PASSWORD,
'charset' => 'UTF8'
], $config)->getConnection();
$connection->executeUpdate('CREATE DATABASE '.MYSQL_DATABASE.' CHARACTER SET utf8 COLLATE utf8_general_ci');
}
return ConsoleRunner::createHelperSet($entityManager);
?>
Basically the script attempts to connect to the specified database, if that fails it attempts to create the database (assuming that the user is allowed to perform database creation that is - might be prudent to delete this file
after deployment).
Source: http://www.cstruter.com/blog/395