使用JDBC链接MySql时出现:The server time zone value '�й���׼ʱ��' is unrecognized or represents more than one

在链接字符串后面加上?serverTimezone=UTCmysql

其中UTC是统一标准世界时间。sql

完整的链接字符串示例:jdbc:mysql://localhost:3306/test?serverTimezone=UTCspa

或者还有另外一种选择: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=UTCcode

相关文章
相关标签/搜索