This error is caused by the SQL syntax used for creating the table. The issue lies with the column name read
, which is a reserved keyword in MySQL. To fix this issue, you need to rename the read
column to something that is not a reserved keyword. You can rename it to is_read
or anything else that makes sense in your context. Here’s how you can modify your table creation script:
create table notification (
id INT UNIQUE AUTO_INCREMENT,
to varchar(255),
name varchar(255),
created_at datetime(6),
remark varchar(255),
is_read bit not null, ---------------------Renamed from `read`
) engine=
Java