MySQL 5.5 & 5.6 default values

纵然是瞬间 提交于 2019-12-03 02:10:24

The behavior you showed above in 5.5 was actually a bug. This was fixed in 5.6.11. Check out the release notes for 5.6.11 at the very bottom. It was part of bugs 68472 and 16394472 (which I can't actually find a link to).

If you turn the explicit_defaults_for_timestamp flag off, it SHOULD work as it did in 5.5

This was the exact same issue that I had with our DB when we updated from 5.5 to 5.6.

Did you try omitting the column?

INSERT INTO `test` () VALUES ();
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!