gorm - 执行数据库迁移操作时异常:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'json

起因:执行数据库迁移操作时异常

Error 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'json,`creator` varchar(32),`updater` varchar(32),`created_at` datetime(3) NULL,`' at line 1

 

原因:迁移数据中有json格式的字段,但由于你的mysql版本较低,无法适配。

解决:mysql 升级到5.7.8及以上版本即可(5.7.8 开始支持原生的 json 数据类型)。

 

posted @   _Q  阅读(32)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
历史上的今天:
2023-11-27 Django - 多条queryset合并,并排序
点击右上角即可分享
微信分享提示