Home > Database > Mysql Tutorial > MySQL设置foreign_key_checks_MySQL

MySQL设置foreign_key_checks_MySQL

WBOY
Release: 2016-06-01 13:10:39
Original
1878 people have browsed it

报错:

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
Copy after login

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

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template