jdk8连接mysql数据库错误

Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
2019-07-09 14:50:42.304  INFO 4196 --- [  restartedMain] com.alibaba.druid.pool.DruidDataSource   : {dataSource-1} inited

错误原因:连接数据库驱动类错误

com.mysql.jdbc.Driver》》》》》》》》》》》》》》》com.mysql.cj.jdbc.Driver

 errorCode 0, state 01S00 

错误信息:无效连接字符串

修改方法:修改连接数据库的链接

原链接

jdbc:mysql://localhost:3306/jdbcboot

修改后链接

jdbc:mysql://localhost:3306/jdbcboot?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
扫描二维码关注公众号,回复: 8894521 查看本文章
发布了35 篇原创文章 · 获赞 11 · 访问量 5万+

猜你喜欢

转载自blog.csdn.net/bokerr/article/details/95196336