当前位置:网站首页>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服务就行了
边栏推荐
- 权限管理怎么做的?
- Image processing tool design
- 24. 请你谈谈单例模式的优缺点,注意事项,使用场景
- 这个项目太有极客范儿了
- typescript17 - function optional parameters
- Adding, deleting, modifying and checking the foundation of MySQL
- Error ER_NOT_SUPPORTED_AUTH_MODE Client does not support authentication protocol requested by serv
- 【Yugong Series】July 2022 Go Teaching Course 019-For Circular Structure
- 程序员工作三年攒多少钱合适?
- 过滤器(Filter)
猜你喜欢

Mysql systemized JOIN operation example analysis

Meeting OA project pending meeting, all meeting functions

typescript15- (specify both parameter and return value types)

Jmeter参数传递方式(token传递,接口关联等)

Typescript14 - (type) of the specified parameters and return values alone

Preparations for web vulnerabilities

Error ER_NOT_SUPPORTED_AUTH_MODE Client does not support authentication protocol requested by serv

typescript16-void

typescript9 - common base types

ShardingSphere之读写分离(八)
随机推荐
Gabor filter study notes
Shell编程之条件语句
MySQL的触发器
Neural Network (ANN)
WMware Tools安装失败segmentation fault解决方法
牛客网刷题训练(四)
响应式布局与px/em/rem的比对
Rocky/GNU之Zabbix部署(2)
[Yugong Series] July 2022 Go Teaching Course 015-Assignment Operators and Relational Operators of Operators
【Yugong Series】July 2022 Go Teaching Course 017-IF of Branch Structure
A complete guide to avoiding pitfalls for the time-date type "yyyy-MM-dd HHmmss" in ES
typescript16-void
Mysql systemized JOIN operation example analysis
MySQL database constraints, table design
go mode tidy出现报错go warning “all“ matched no packages
DOM系列之 offset 系列
【Multithreading】
【愚公系列】2022年07月 Go教学课程 019-循环结构之for
程序员工作三年攒多少钱合适?
【Demo】ABAP Base64加解密测试