====== Trouble Shooting ====== ===== TimeZone error ===== JAVA에서 MySQL 혹은 MariaDB 서버에 연결시 다음과 같은 에러가 발생 할 수 있다. ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: Cannot create PoolableConnectionFactory (The server time zone value xxxxx is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.) 현재 데이터베이스의 타임존을 확인한다. SELECT @@global.time_zone, @@session.time_zone; 타임존이 SYSTEM으로 확인된다면 별도로 지정되어 있지 않다는 뜻이다. * JDBC URL에 옵션추가 *데이터베이스 서버에 default-time-zone 설정하기 *my.ini 파일에 [mysqlId] 섹션에 default-time-zone을 추가한다. 아래는 KST로 지정한 것이다. [mysqld] default-time-zone='+9:00' default-time-zone='UTC' 형식으로 설정하면 에러가 발생한다.(MariaDB, MySQL 동일) UTC로 지정하기 위해서는 '+0:00' 또는 '-0:00'으로 설정한다. {{tag>database troubleshooting 천호동밤안개}}