“ groups”在此位置是无效输入

时间:2018-07-14 17:22:31

标签: mysql mysql-workbench

我最近将MySQL Workbench从5.7更新到8.0,并开始在我的SQL脚本中遇到此错误:

enter image description here

我记得它在旧版本的Workbench上工作得很好。救命!

1 个答案:

答案 0 :(得分:1)

根据8.0版本的this文档,单词groups是保留关键字,为了使该create语句起作用,我必须引用该关键字,例如:

create table `groups` (
  id                bigint          AUTO_INCREMENT PRIMARY KEY,
  title             nvarchar(100),
  description       nvarchar(500),
  visibility        int,
  keywords          nvarchar(200),
  score             bigint          default 0,
  isDeleted         boolean         default false,
  addedBy           bigint          not null,
  lastModifiedBy    bigint          not null,
  addedOn           timestamp       not null default current_timestamp,
  lastModifiedOn    timestamp       not null default current_timestamp on update current_timestamp
);