当前位置:Gxlcms > mysql > MySQL设置foreign_key_checks_MySQL

MySQL设置foreign_key_checks_MySQL

时间:2021-07-01 10:21:17 帮助过:18人阅读

报错:

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 ;

人气教程排行