I need do it this, and work correctly:
- To disable strict SQL mode, SSH in to your server as root
- Create this file: /etc/mysql/conf.d/disable_strict_mode.cnf
-
Open the file and enter these two lines:
[mysqld] sql_mode=IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
-
Restart MySQL with this command: sudo service mysql restart
https://stackoverflow.com/questions/11040207/disabling-mysql-strict-mode
本文介绍了一种禁用MySQL严格模式的方法,通过在服务器上创建并编辑配置文件disable_strict_mode.cnf,设置sql_mode参数,然后重启MySQL服务,实现禁用严格模式,避免因数据类型不匹配导致的插入失败问题。
1万+

被折叠的 条评论
为什么被折叠?



