当前位置:网站首页>Mysql: Invalid default value for TIMESTAMP
Mysql: Invalid default value for TIMESTAMP
2022-07-31 00:58:00 【Your Highness the Peach Blossom】
The timestamp must have a default value when creating a table

I searched a lot on the Internet, and what about set sql_model, the results are all restored after restarting the service
After doing a lot of work on the Internet, the most useful thing is to change the configuration in my.ini


After modifying sql_mode, then restart the service.
First sql query the default sql_mode, and then paste the value out
show variables like 'sql_mode';Change the NO_ZERO_DATE in the value to ALLOW_INVALID_DATES
Then paste into my.ini
Note here that sql_mode will be different depending on the version, mine is version 5.7
Also, the installation-free version of mysql does not use my.ini by default, but mydefault.ini. Copy the content of the defailt, create a my.ini file, paste it in, and restart the mysql service.
边栏推荐
猜你喜欢

typescript13 - type aliases

Kotlin协程:协程上下文与上下文元素

DOM系列之 client 系列

【多线程】

Unity2D horizontal version game tutorial 4 - item collection and physical materials

typescript13-类型别名
![[C language course design] C language campus card management system](/img/36/9e1a97767bbe1e504d8a3cc3ce5448.png)
[C language course design] C language campus card management system

ShardingSphere之未分片表配置实战(六)

网站频繁出现mysql等数据库连接失败等信息解决办法

typescript10-commonly used basic types
随机推荐
RTL8720DN开发笔记一 环境搭建与mqtt实例
XSS related knowledge
typescript10-常用基础类型
分布式.分布式锁
Zabbix干啥用?
822. 走方格
Oracle has a weird temporary table space shortage problem
Rocky/GNU之Zabbix部署(3)
人工智能与云安全
场景之多数据源查询及数据下载问题
【952. 按公因数计算最大组件大小】
typescript12-联合类型
[Yugong Series] July 2022 Go Teaching Course 015-Assignment Operators and Relational Operators of Operators
【愚公系列】2022年07月 Go教学课程 016-运算符之逻辑运算符和其他运算符
Responsive layout vs px/em/rem
GO GOPROXY代理设置
Error ER_NOT_SUPPORTED_AUTH_MODE Client does not support authentication protocol requested by serv
API 网关 APISIX 在Google Cloud T2A 和 T2D 的性能测试
mysql主从复制及读写分离脚本-亲测可用
查看zabbix-release-5.0-1.el8.noarch.rpm包内容