MySQL server version for the right syntax to use near 'type = InnoDB' at line 25

来源:互联网 发布:怎么用matlab编程 编辑:程序博客网 时间:2024/06/05 16:46

使用PowerDesigner 生成了sql脚本(摘抄部分):

/*==============================================================*//* DBMS name:      MySQL 5.0                                    *//* Created on:     2017/8/29 11:15:50                           *//*==============================================================*//*==============================================================*//* Table: f_discuss_service_predetermine                        *//*==============================================================*/create table f_discuss_service_predetermines(   ID                   bigint(20) not null comment '主键',   TENANT_ID            varchar(200) comment '租户Id',   CREATOR              varchar(80) not null comment '创建人名称',   CREATE_USER_ID       bigint(20) not null comment '创建人用户ID',   CREATE_TIME          datetime not null comment '创建时间',   MODIFY_USER          varchar(80) comment '最后修改人名称',   MODIFY_USER_ID       bigint(20) comment '最后修改人用户ID',   MODIFY_TIME          datetime comment '最后修改时间',   BUSINESS_ID          bigint(20) not null comment '业务id',   SERVICE_STAGE_CODE   varchar(20),   SERVICE_ID           bigint(20),   BINDING_SERVCIE_ID   bigint(20),   primary key (ID))type = InnoDB;alter table f_discuss_service_predetermine comment '服务预定信息';

执行错误:

[Err] 1064 - 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 'type = InnoDB' at line 25


很显然,这是MySQL的版本问题导致的,实际上,在MySQL5.0以前,type=InnoDB是有效的SQL语句,但是自己用的是MySQL5.6版本,type=InnoDB不再有效了。

可将这语句删除,再执行。

也可以改成 : ENGINE=InnoDB 

注:这里表会采用默认引擎,MySQL5.5.5版本之后采用的默认引擎就是InnoDB

阅读全文
0 0
原创粉丝点击