엄지월드

Caused by: java.sql.SQLSyntaxErrorException: 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 'bigint, start_value ) as start_value, convert( bigint, minimum_value ) as.. 본문

java/Spring

Caused by: java.sql.SQLSyntaxErrorException: 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 'bigint, start_value ) as start_value, convert( bigint, minimum_value ) as..

킨글 2022. 9. 7. 09:26
반응형

새로운 프로젝트에 DB 설정에 문제가 있어서 DB를 설치하고 실행했더니 아래와 같은 에러를 만났다.

SQL syntax 에러라고 뜨는데.. 나는 JPA를 사용하고 있어서 SQL을 작성한게 없다.

Caused by: java.sql.SQLSyntaxErrorException: 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 'bigint, start_value ) as start_value, convert( bigint, minimum_value ) as minimu' at line 1

그래서 application.properties 파일에 아래와 같이 추가한 부분을 제거해주었다. 

이유는 spring.jpa.database 부분은 사용하는 데이터베이스를 지정해주는 것인데, sql-server로 작성되어 있어서 에러가 났던 것이다.

mysql을 사용하는 경우, spring.jpa.database=mysql이라고 입력하고 실행해주면 에러가 나지 않는 것을 확인할 수 있다. 

spring.jpa.database=sql-server

 

 

 

 

Comments