当前位置:网站首页>Mysql:Invalid default value for TIMESTAMP
Mysql:Invalid default value for TIMESTAMP
2022-07-31 00:54:00 【桃花妖殿下】
建表的时候报时间戳得有默认值

网上搜了一大堆,又什么set sql_model啥的,结果都是重启服务就还原了
后来在网上搞了一大堆,最有用的就是my.ini里改配置


修改完sql_mode,然后重启服务就好了
先sql查询下默认的sql_mode,然后把值粘贴出来
show variables like 'sql_mode';把值里的NO_ZERO_DATE改成ALLOW_INVALID_DATES
然后粘贴进my.ini
这里注意下sql_mode会根据版本的不同不一样,我的是5.7版本的
还有就是免安装版的mysql默认没用my.ini,而是mydefault.ini,把defailt那个里面内容复制出来然后创建my.ini文件再粘贴进去,重启mysql服务就行了
边栏推荐
- Mini Program - Global Data Sharing
- typescript11 - data types
- Go 学习笔记(84)— Go 项目目录结构
- Go study notes (84) - Go project directory structure
- 297. 二叉树的序列化与反序列化
- Shell programming of conditional statements
- background has no effect on child elements of float
- Niuke.com question brushing training (4)
- Unity2D horizontal version game tutorial 4 - item collection and physical materials
- The client series of the DOM series
猜你喜欢
随机推荐
查看zabbix-release-5.0-1.el8.noarch.rpm包内容
分布式.分布式锁
background has no effect on child elements of float
87. 把字符串转换成整数
MySQL的触发器
unity2D横版游戏教程4-物品收集以及物理材质
系统设计.短链系统设计
【愚公系列】2022年07月 Go教学课程 019-循环结构之for
【愚公系列】2022年07月 Go教学课程 016-运算符之逻辑运算符和其他运算符
Shell编程之条件语句
Gabor filter study notes
解决:Parameter 0 of method ribbonServerList in com.alibaba.cloud.nacos.ribbon.NacosRibbonClientConfigu
Detailed explanation of 9 common reasons for MySQL index failure
ShardingSphere read-write separation (8)
(5) fastai application
Zabbix干啥用?
【愚公系列】2022年07月 Go教学课程 017-分支结构之IF
Typescript14 - (type) of the specified parameters and return values alone
权限管理怎么做的?
场景之多数据源查询及数据下载问题









