在Z平台启动过程中,如果发现如下错误:
Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: Cannot create PoolableConnectionFactory (The server time zone value '?й???????' 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.)
该错误是使用MySQL8.0版本及以上版本数据库时,在连接URL中,未指定时区或时区错误导致的。
处理方法如下:
jdbc:mysql://IP地址:端口号/实例名?serverTimezone=GMT%2B8&useSSL=false