我有一个使用Symfony2和Doctrine的项目。在某一时刻,我失去了通过控制台命令创建/删除数据库的能力,例如:
app/console doctrine:database:drop --force
app/console doctrine:database:create
app/console doctrine:schema:update --force
如果我尝试创建数据库,Doctrine会给我以下错误:
[Doctrine\DBAL\Exception\ConnectionException]
An exception occured in driver: SQLSTATE[08006] [7] FATAL: database "motherhood" does not exist
所以,我可以使用Symfony配置在psql中创建带有用户的数据库。如果我尝试通过Doctrine删除现有的数据库,会出现以下错误:
SQLSTATE[55006]: Object in use: 7 ERROR: database "motherhood" is being accessed by other users
DETAIL: There are 1 other session using the database.
但是这个数据库没有连接