Java web开发中遇到的一些问题及解决方法

使用JDBC连接MySql时出现: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

解决:
在连接字符串后面加上?serverTimezone=UTC
其中UTC是统一标准世界时间。

或者还有另一种选择:jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=UTF-8,这个是解决中文乱码输入问题,当然也可以和上面的一起结合:jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC

原文:https://blog.csdn.net/aayygg1234/article/details/78205240

idea连接mysql数据库时出现异常java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

常规方法使用后仍未解决,可能是驱动包版本的问题,更换高版本的驱动包可能解决该问题

猜你喜欢

转载自blog.csdn.net/HuangGang_clown/article/details/85697906
今日推荐