每当我尝试加载数据夹具时,我都会收到此错误:
[Doctrine\DBAL\DBALException]
An exception occurred while executing 'DELETE FROM Group':
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error i
n your SQL syntax; check the manual that corresponds to your MySQL server v
ersion for the right syntax to use near 'Group' at line 1
我不想修改教条,但显然它没有使用正确的语法。我需要以不同的方式配置学说吗?我使用smyfony2与mysql和基本教条包。贝娄是我的composer.json文件:
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.3.*",
"doctrine/orm": ">=2.2.3,<2.4-dev",
"doctrine/doctrine-bundle": "1.2.*",
"twig/extensions": "1.0.*",
"symfony/assetic-bundle": "2.3.*",
"symfony/swiftmailer-bundle": "2.3.*",
"symfony/monolog-bundle": "2.3.*",
"sensio/distribution-bundle": "2.3.*",
"sensio/framework-extra-bundle": "2.3.*",
"sensio/generator-bundle": "2.3.*",
"incenteev/composer-parameter-handler": "~2.0",
"doctrine/orm": "*",
"phpunit/phpunit": "3.7.*",
"doctrine/doctrine-migrations-bundle": "dev-master",
"doctrine/migrations": "dev-master",
"doctrine/doctrine-fixtures-bundle": "dev-master",
"doctrine/data-fixtures": "dev-master",
"ircmaxell/password-compat": "dev-master"
},
答案 0 :(得分:3)
Group
是mysql
中的关键字。所以你可能想逃避它。
DELETE FROM `Group`