Web

mysql 연동 에러들

tose33 2022. 7. 8. 21:43

1. mysql server time zone value is unrecognized 에러 

https://ubiq.co/database-blog/how-to-change-mysql-server-time-zone/

 

How To Change MySQL Server Time Zone - Ubiq BI

Sometimes you may need to change MySQL server time zone to UTC or change timezone in cPanel. Here's how to change MySQL server time zone.

ubiq.co

구글링 결과 mysql connector를 옛 버전으로 바꾸면 된다고 했지만 바꿔봤는데도 실패.

 

mysql> SET GLOBAL time_zone = '-6:00';

 

GLOBAL 타임존을 변경했더니 성공.

 

 

2. mysql java.math.BigInteger cannot be cast to java.lang.Long 에러

mysql 버전과 connector 버전이 서로 달라서 발생.

cmd에서 mysql -V 로 mysql 버전확인해서 connector도 같은 버전으로 받아야함.

pom.xml에서도 버전 수정해줘야함.

 

 

3. "com.mysql.jdbc.Driver" is deprecated 

 

https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-api-changes.html

 

MySQL :: MySQL Connector/J 8.0 Developer Guide :: 4.4.1.3 Changes in the Connector/J API

4.4.1.3 Changes in the Connector/J API This section describes some of the more important changes to the Connector/J API going from version 5.1 to 8.0. You might need to adjust your API calls accordingly: The name of the class that implements java.sql.Driv

dev.mysql.com

말 그대로 해당 드라이버가 더이상 사용되지 않는다는 뜻.

찾아보니 클래스 이름이 com.mysql.cj.jdbc.Driver 으로 바뀌었다.