标签:jar包 false encoding localhost OLE roo art unicode mys
mysql由5.0升级至8.0
1:jar包的变换
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.1</version>
</dependency>
2:驱动的升级
由原来的com.mysql.jdbc.Driver变换为com.mysql.cj.jdbc.Driver。
3:数据库地址
需要在url末尾加上?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8&useSSL=false
例如
ComboPooledDataSource dataSource = new ComboPooledDataSource();
dataSource.setDriverClass("com.mysql.cj.jdbc.Driver");
dataSource.setJdbcUrl(
"jdbc:mysql://localhost:3306/ssm_study?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8&useSSL=false");
dataSource.setUser("root");
dataSource.setPassword("11111");
标签:jar包 false encoding localhost OLE roo art unicode mys
原文地址:https://www.cnblogs.com/czhj/p/14702779.html