我的SQLSyntaxErrorException:升级时您的 SQL 语法有错误
MySQLSyntaxErrorException: You have an error in your SQL syntax while upgrading
我正在从 MySQL 5.7.22(连接器 v5.1.40)升级到 MySQL 版本 8.0.18,使用 mysql-连接器-java v5.1.48 (JRE 和 JDK 7)。我正在使用 ddl 脚本创建 table,一些 table 已成功创建,但对于一个 table,我收到以下错误。
create table servicegroup(
id bigint(20) auto_increment,
name varchar(255),
description varchar(255),
recursive BIT,
created datetime,
modified datetime,
type varchar(255),
primary key (id)
)
错误信息。
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 'recursive BIT,
created datetime,
modified datetime,
type varchar(255),
primary k' at line 5
我该如何解决这个问题?
从上一条评论开始,recursive
是保留关键字,因此不能用作任何 table 名称或列名。
我正在从 MySQL 5.7.22(连接器 v5.1.40)升级到 MySQL 版本 8.0.18,使用 mysql-连接器-java v5.1.48 (JRE 和 JDK 7)。我正在使用 ddl 脚本创建 table,一些 table 已成功创建,但对于一个 table,我收到以下错误。
create table servicegroup(
id bigint(20) auto_increment,
name varchar(255),
description varchar(255),
recursive BIT,
created datetime,
modified datetime,
type varchar(255),
primary key (id)
)
错误信息。
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 'recursive BIT, created datetime, modified datetime, type varchar(255), primary k' at line 5
我该如何解决这个问题?
从上一条评论开始,recursive
是保留关键字,因此不能用作任何 table 名称或列名。