In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
How to solve the error when creating tables in MySQL database: Invalid default value for 'create_date'? I believe that many novice rookies can do nothing about this. Through the summary of this article, I hope you can find a solution.
Scene
[Err] 1067-Invalid default value for 'create_date', for creating a table type is as follows:
`create_ date`timestamp (0) NOT NULL ON UPDATE CURRENT_TIMESTAMP (0) COMMENT 'creation time'
Solve
MySQL5.6.44 and MySQL5.7.27timestamp default value rule change, cannot be "0000 00-0000: 00:00"
Solution:
View sql_mode:
Mysql > show session variables like'% sql_mode%'
+- -- +
| | Variable_name | Value |
+- -- +
| | sql_mode | ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |
+- -- +
1 row in set (0.01 sec)
Modify sql_mode to remove NO_ZERO_IN_DATE,NO_ZERO_DATE:
Mysql > set sql_mode= "ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
After reading this article, can you solve the problem of creating tables in MySQL database independently? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel. Thank you for reading.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.