MySQL设置foreign_key_checks_MySQL
程序员文章站
2022-05-09 15:46:41
...
报错:
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 ;