当前位置:网站首页>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服务就行了
边栏推荐
- typescript14-(单独指定参数和返回值的类型)
- Go study notes (84) - Go project directory structure
- 过滤器(Filter)
- Artificial Intelligence and Cloud Security
- ROS2系列知识(3):环境配置
- Niuke.com question brushing training (4)
- 解决:Parameter 0 of method ribbonServerList in com.alibaba.cloud.nacos.ribbon.NacosRibbonClientConfigu
- MySQL Series 1: Account Management and Engine
- 论文理解:“Designing and training of a dual CNN for image denoising“
- MySQL的触发器
猜你喜欢
Error ER_NOT_SUPPORTED_AUTH_MODE Client does not support authentication protocol requested by serv
【ABAP】MFBF过账到质量检验库存类型Demo
mysql主从复制及读写分离脚本-亲测可用
WMware Tools installation failed segmentation fault solution
typescript14-(单独指定参数和返回值的类型)
Rocky/GNU之Zabbix部署(3)
分布式.幂等性
Rocky/GNU之Zabbix部署(1)
mysql索引失效的常见9种原因详解
不用Swagger,那我用啥?
随机推荐
【多线程】
SereTOD2022 Track2 Code Analysis - Task-based Dialogue Systems Challenge for Semi-Supervised and Reinforcement Learning
Error occurred while trying to proxy request The project suddenly can't get up
Jmeter参数传递方式(token传递,接口关联等)
Image processing tool design
Oracle has a weird temporary table space shortage problem
A complete guide to avoiding pitfalls for the time-date type "yyyy-MM-dd HHmmss" in ES
typescript11 - data types
小程序-全局数据共享
mysql主从复制及读写分离脚本-亲测可用
(5) fastai application
DOM系列之动画函数封装
typescript12 - union types
typescript13 - type aliases
MySQL master-slave replication and read-write separation script - pro test available
DOM系列之scroll系列
解决:Parameter 0 of method ribbonServerList in com.alibaba.cloud.nacos.ribbon.NacosRibbonClientConfigu
Thesis understanding: "Designing and training of a dual CNN for image denoising"
Shell编程之条件语句
Mysql systemized JOIN operation example analysis