简体   繁体   English

将数据库 model 从 MySQLWorkbench 导出到 MariaDB PhpMyAdmin

[英]Export database model from MySQLWorkbench to MariaDB PhpMyAdmin

I designed a database model on MySQLWorkbench.我在 MySQLWorkbench 上设计了一个数据库 model。 Then, I export the model to generate a SQL script.然后,我导出 model 以生成 SQL 脚本。 Finally, when I import it in MariaDB PhpMyAdmin it raises errors like:最后,当我将它导入 MariaDB PhpMyAdmin 时,它会引发如下错误:

#1067 - Invalid default value for 'created' #1067 - 'created' 的默认值无效

MariaDB version: 10.5.4 MariaDB 版本:10.5.4

Do you have any idea?你有什么主意吗?

Here is my solution:这是我的解决方案:

create DATETIME NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP创建 DATETIME NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP

MySQL refused the date to be like this: 0000-00-00 00:00:00 MySQL 拒绝日期是这样的:0000-00-00 00:00:00

I know this is old, but just ran into this, appears Maria 10.5 won't accept invalid inserts even when ALLOW_INVALID_DATES is set in SQL mode, 10.3 would.我知道这是旧的,但刚刚遇到这个,即使在 SQL 模式下设置 ALLOW_INVALID_DATES 时,Maria 10.5 似乎也不会接受无效插入,10.3 会。 I cannot find any reference of this in the documentation, but I can insert invalid dates in 10.3 and cannot in 10.5 on several server I've tested on.我在文档中找不到任何引用,但我可以在 10.3 中插入无效日期,而不能在我测试过的几台服务器上的 10.5 中插入。 Dealing with this in an upgrade from 10.3 on a large database and regardless of whether allowing nulls is a good practice, it's broken a massive application as a result and we're bailing back to 10.3.在大型数据库上从 10.3 升级时处理此问题,无论允许空值是否是一种好习惯,它都会破坏大型应用程序,我们将退回到 10.3。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM