小编Anu*_*Anu的帖子

无法使用Doctrine和Symfony2在MySQL中创建表

我正在使用MySql使用Symfony2和Doctrine ORM.

创建实体后,我无法创建表.它引发了一个例外.

anu@anu-bridge:/var/www/Symfony$ php app/console doctrine:schema:update --force --dump-sql

[Doctrine\DBAL\Schema\SchemaException]
The table with name 'product' already exists.  

doctrine:schema:update [--complete] [--dump-sql] [--force] [--em[="..."]]
Run Code Online (Sandbox Code Playgroud)

我试图放弃它,但仍然会抛出错误.

anu@anu-bridge:/var/www/Symfony$ php app/console doctrine:schema:drop --force
Dropping database schema...

[Doctrine\DBAL\Schema\SchemaException]         
The table with name 'product' already exists.  

doctrine:schema:drop [--dump-sql] [--force] [--full-database] [--em[="..."]]

[Doctrine\DBAL\Schema\SchemaException]         
The table with name 'product' already exists.
Run Code Online (Sandbox Code Playgroud)

数据库中没有表.清除了symfony和doctrine的所有缓存,但仍然是错误抛出.

Symfony2版本是2.0.1.

mysql symfony doctrine-orm

27
推荐指数
2
解决办法
2万
查看次数

标签 统计

doctrine-orm ×1

mysql ×1

symfony ×1