I\'m trying to start spring boot project with MySQL database, but I have some problem with database. I try to start my application that, and server is running but hibernate don\
Hmm I also encountered this issue but either of those solutions could not solve my issue. I am using MySQL database packaging with XAMPP. What I tried out to solve but failed
So what I did to solve this issue. Might be yours
Friends it actually my circumstances, might be help your issue like me. If you have any question please post comment. Thanks
Ran into similar issue and found SupaMario's answer here.
In my case I had a table named orders
but MySql threw the error as it seems to be a reserve table / keyword.
I changed it to customer_order
and it all worked fine.
Change The dialect of hibernate.cfg.xml Dialect :- org.hibernate.dialect.MySQL5InnoDBDialect OR org.hibernate.dialect.MySQL55Dialect OR org.hibernate.dialect.MySQL55InnoDBDialect OR org.hibernate.dialect.MySQL57InnoDBDialect
Ok, had the same issue. Adding prefixes fixed the problem for me:
from:
`
@Entity
@Table(name = "result_man")
@Proxy(lazy = false)
public class ResultManEntity {
@Id
@GeneratedValue
@Column(name = "id", unique = true, length = 128)
private long id;
private String key;
private int score;
private int index;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "result_id")
private ResultEntity result;
}`
to:
`@Entity
@Table(name = "result_man")
@Proxy(lazy = false)
public class ResultManEntity {
@Id
@GeneratedValue
@Column(name = "id", unique = true, length = 128)
private long id;
private String _key;
private int _score;
private int _index;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "result_id")
private ResultEntity result;`
In my case the problem why i got this exception was, that some tables had names which are reserved for postgreSQL. eg. "Like" or "User". Changed name with:
@Table(name="likes")
and it worked fine. Perhaps someone has the same problem.
Change spring.jpa.hibernate.ddl-auto = create-drop to update. It is dropping the database at start so wont find the required events table to alter anything.