使用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
2017-05-26 04:46
501 查看
在连接字符串后面加上?serverTimezone=UTC
其中UTC是统一标准世界时间。
完整的连接字符串示例:jdbc:mysql://localhost:3306/test?serverTimezone=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&[b]serverTimezone=UTC[/b]
其中UTC是统一标准世界时间。
完整的连接字符串示例:jdbc:mysql://localhost:3306/test?serverTimezone=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&[b]serverTimezone=UTC[/b]
相关文章推荐
- 使用powerdesigner连接数据库时出现Non SQL Error : Could not load class com.mysql.jdbc.Drive
- 使用jdbc连接mysql 出现 java.sql.Exception: this specifer does...(root@'%')..doesn't exist.
- Java使用mysql-jdbc连接MySQL出现如下警告:
- tomcat使用jdbc连接mysql出现的错误
- ubuntu16.04下eclipse使用 jdbc连接本地mysql出现:Communications link failure错误
- Java使用mysql-jdbc连接MySQL出现如下警告: WARN: Establishing SSL connection without server's identity 。。。
- 使用powerdesigner连接数据库时出现Non SQL Error : Could not load class com.mysql.jdbc.Drive
- 使用powerdesigner连接数据库时出现Non SQL Error : Could not load class com.mysql.jdbc.Drive
- 使用powerdesigner连接数据库时出现Non SQL Error : Could not load class com.mysql.jdbc.Drive
- 使用TOMCAT5.5连接池连接mysql(解决Cannot create JDBC driver of class '' for connect URL 'null')
- 使用TOMCAT5.5连接池连接mysql(解决Cannot create JDBC driver of class '' for connect URL 'null')
- java使用JDBC连接MYSQL
- 使用TOMCAT5.5连接池连接mysql(解决Cannot create JDBC driver of class '' for connect URL 'null')
- 用JDBC,Java连接MySQL并使用prepareStatement
- 使用TOMCAT5.5连接池连接mysql(解决Cannot create JDBC driver of class '' for connect URL 'null' 及can not load org.gjt.mm.mysql.Driver)
- 使用JDBC连接Mysql的3种方式
- 使用jdbc连接oracle数据库出现的问题
- Linux下Java连接Mysql 出现“ClassNotFoundException:com.mysql.jdbc.Driver”
- JDBC连接数据库速查(Oracle8/8i/9i,DB2,MySQL各种数据库使用JDBC连接的方式)
- 【MySQL使用技巧】JDBC连接