Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
对于具有批量插入的特定 PHP 文件,我需要设置UNIQUE_CHECKS为 0,我只想知道它保持 0 多长时间?手动批量插入后是否必须设置UNIQUE_CHECKS为 1 或者它会自动更改为默认的 GLOBAL 变量值?
UNIQUE_CHECKS
UNIQUE_CHECKS是每个连接设置的 MySQL 变量。连接关闭的那一刻(通常在脚本结束时或使用适当的 MySQL 客户端命令时),设置结束了它的生命周期。
下次启动新连接时,将再次获取 MySQL 配置中的值。