当前位置:网站首页>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服务就行了
边栏推荐
- typescript10-commonly used basic types
- Yolov7实战,实现网页端的实时目标检测
- typescript13-类型别名
- Oracle has a weird temporary table space shortage problem
- 【952. 按公因数计算最大组件大小】
- BOM系列之Navigator对象
- Solution: Parameter 0 of method ribbonServerList in com.alibaba.cloud.nacos.ribbon.NacosRibbonClientConfigu
- (5) fastai application
- Common network status codes
- 响应式布局与px/em/rem的比对
猜你喜欢

typescript13 - type aliases

Rocky/GNU之Zabbix部署(2)

typescript9 - common base types

Mini Program - Global Data Sharing

How to Add a Navigation Menu on Your WordPress Site

Yolov7实战,实现网页端的实时目标检测

In Google Cloud API gateway APISIX T2A and T2D performance test

Rocky/GNU之Zabbix部署(3)

Error ER_NOT_SUPPORTED_AUTH_MODE Client does not support authentication protocol requested by serv

华为“天才少年”稚晖君又出新作,从零开始造“客制化”智能键盘
随机推荐
typescript15- (specify both parameter and return value types)
MySql data recovery method personal summary
论文理解:“Designing and training of a dual CNN for image denoising“
【多线程】
不用Swagger,那我用啥?
解决:Parameter 0 of method ribbonServerList in com.alibaba.cloud.nacos.ribbon.NacosRibbonClientConfigu
typescript11-数据类型
网站频繁出现mysql等数据库连接失败等信息解决办法
typescript13-类型别名
权限管理怎么做的?
Zabbix干啥用?
typescript9-常用基础类型
24. 请你谈谈单例模式的优缺点,注意事项,使用场景
Consistency and Consensus of Distributed Systems (1) - Overview
unity2D横版游戏教程4-物品收集以及物理材质
In Google Cloud API gateway APISIX T2A and T2D performance test
typescript16-void
Oracle has a weird temporary table space shortage problem
Shell编程之条件语句
查看zabbix-release-5.0-1.el8.noarch.rpm包内容