且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

MySQL 不正确的日期时间值:'0000-00-00 00:00:00'

更新时间:2022-06-13 10:19:28

我的建议,如果是空表或不是很大的情况,将create语句导出为.sql文件,按照你的方式重写希望.如果您有任何现有数据,也请执行相同操作,即导出插入语句(我建议在单独的文件中执行此操作作为创建语句).最后删除表,先执行create语句再插入.

My suggestion if it is the case that the table is empty or not very very big is to export the create statements as a .sql file, rewrite them as you wish. Also do the same if you have any existing data, i.e. export insert statements (I recommend doing this in a separate file as the create statements). Finally, drop the table and execute first create statement and then inserts.

您可以使用 mysqldump 命令,包含在您的 MySQL 安装中,或者您也可以安装 MySQL Workbench,这是一个免费的图形工具,它也以非常可定制的方式包含此选项,而无需寻找特定的命令选项.

You can use for that either mysqldump command, included in your MySQL installation or you can also install MySQL Workbench, which is a free graphical tool that includes also this option in a very customisable way without having to look for specific command options.