首页 >数据库 >mysql教程 >MySQL设置foreign_key_checks_MySQL

MySQL设置foreign_key_checks_MySQL

WBOY
WBOY原创
2016-06-01 13:10:391876浏览

报错:

C:/xampp/htdocs/yun_course>php app/console doctrine:schema:update --forceUpdating database schema...  [Doctrine/DBAL/DBALException]  An exception occurred while executing 'ALTER TABLE cc_forum_post ADD CONSTR  AINT FK_7226C324CEB06035 FOREIGN KEY (fk_created_by_user_id) REFERENCES use  r (id) ON DELETE SET NULL':  SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint  [PDOException]  SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint

在mysql>输入SET @@global.foreign_key_checks = 0 ;

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn