mysql外键约束取消

SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;

SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;

SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO";

SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0;

~~~~~~~~~~~~~~~上面加开头,下面加结尾

SET SQL_MODE=@OLD_SQL_MODE;


SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;


SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;


/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;

/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;

/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;


SET SQL_NOTES=@OLD_SQL_NOTES;

你可能感兴趣的:(mysql外键约束取消)