1、查找mysqld
$ which mysqld /usr/sbin/mysqld
2、查找my.cnf位置
$ /usr/sbin/mysqld --verbose --help | grep -A 1 'Default options' /etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf ~/.my.cnf
3、使用vim打开/etc/my.cnf
$ vim /etc/my.cnf
4、修改配置,把,STRICT_TRANS_TABLES这个删除就行了
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
如果没有,就直接添加
sql_mode=NO_ENGINE_SUBSTITUTION
5、重启mysql
$ service mysqld restart
修改后,如有些提示,像:
ERROR 1364 (HY000): Field 'name' doesn't have a default value
就不会提示了。
推荐:《mysql视频教程》
以上就是关于linux下mysql去除严格模式的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号