故障报告
1. 问题(故障)描述
java.sql.SQLException: Cannot create PoolableConnectionFactory (The server time zone value 'PDT' 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 specific time zone value if you want to utilize time zone support.)
at org.apache.commons.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:656)
at org.apache.commons.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:534)
at org.apache.commons.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:734)
at com.zcbus.DataBus.dbDict.DbCommon.TestConn(DbCommon.java:75)
at com.zcbus.DataBus.dbDict.DbCommon.ParseConnect(DbCommon.java:59)
at com.zcbus.main.ZcbusDDLMain.InitSession(ZcbusDDLMain.java:67)
at com.zcbus.main.ZcbusDDLMain.StartParseDDL(ZcbusDDLMain.java:138)
at com.demo.DDLParseMain.DealDDL(DDLParseMain.java:351)
at com.demo.DDLParseMain.ParseParameter(DDLParseMain.java:33)
at com.demo.DDLParseMain.<init>(DDLParseMain.java:22)
at com.demo.DDLParseMain.main(DDLParseMain.java:26)
2. 问题(故障)原因
终端显示的时间和MySQL中显示的时间不一致
3. 解决
#设置时区更改为东八区
set global time_zone = '+8:00';
#刷新配置
flush privileges;
4. 参考
https://blog.csdn.net/u014662563/article/details/61923884
文档更新时间: 2024-05-16 16:48 作者:程少波