I am upgrading from MySQL 5.7.22 (connector v5.1.40) to MySQL version 8.0.18 with mysql-connector-java v5.1.48 (JRE and JDK 7). And I am creating table using ddl script, some of the tables are created successfully, but for one table I get following error.
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)
)
Error message.
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
How can I resolve this?
recursive BIT. I don't know why there is the problem with the data name recursive. It will work if you change the name of BIT field to any other the code works. Please try changing the name if you can. - Santosh Aryalnameortypethat is a reserved word. - halferrecursiveis a registered keyword: dev.mysql.com/doc/refman/8.0/en/… , try to avoidname/typeas well (its also in the list). Or surround them in backticks, as already suggested. - Caramiriel