栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

报错:com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure useSSL=false

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

报错:com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure useSSL=false

启动renrenfast项目一直报错:

2021-10-08 12:27:34.228  INFO 22872 --- [           main] io.renren.RenrenApplication              : Starting RenrenApplication on DESKTOP-R1MDH9A with PID 22872 (D:WorkSpaceDCgulimallrenren-fasttargetclasses started by chang in D:WorkSpaceDCgulimall)
2021-10-08 12:27:34.231 DEBUG 22872 --- [           main] io.renren.RenrenApplication              : Running with Spring Boot v2.2.4.RELEASE, Spring v5.2.3.RELEASE
2021-10-08 12:27:34.231  INFO 22872 --- [           main] io.renren.RenrenApplication              : The following profiles are active: dev
2021-10-08 12:27:35.036  INFO 22872 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
2021-10-08 12:27:35.038  INFO 22872 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
2021-10-08 12:27:35.071  INFO 22872 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 23ms. Found 0 Redis repository interfaces.
2021-10-08 12:27:35.261  INFO 22872 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'shiroConfig' of type [io.renren.config.ShiroConfig$$EnhancerBySpringCGLIB$$1f51570c] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-10-08 12:27:35.353  INFO 22872 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'mybatis-plus-com.baomidou.mybatisplus.autoconfigure.MybatisPlusProperties' of type [com.baomidou.mybatisplus.autoconfigure.MybatisPlusProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-10-08 12:27:35.357  INFO 22872 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'mybatisPlusConfig' of type [io.renren.config.MybatisPlusConfig$$EnhancerBySpringCGLIB$$827d5e28] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-10-08 12:27:35.361  INFO 22872 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'paginationInterceptor' of type [com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-10-08 12:27:35.366  INFO 22872 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration' of type [com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration$$EnhancerBySpringCGLIB$$f99e2814] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-10-08 12:27:35.368  INFO 22872 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'dynamic-io.renren.datasource.properties.DynamicDataSourceProperties' of type [io.renren.datasource.properties.DynamicDataSourceProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-10-08 12:27:35.369  INFO 22872 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'dynamicDataSourceConfig' of type [io.renren.datasource.config.DynamicDataSourceConfig$$EnhancerBySpringCGLIB$$22f6d55c] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-10-08 12:27:35.374  INFO 22872 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'dataSourceProperties' of type [io.renren.datasource.properties.DataSourceProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-10-08 12:27:35.824 ERROR 22872 --- [           main] com.alibaba.druid.pool.DruidDataSource   : init datasource error, url: jdbc:mysql://192.168.56.10:3306/gulimall_admin?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

url后需要加&useSSL=false 就可以解决

 url: jdbc:mysql://192.168.56.10:3306/gulimall_admin?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useSSL=false

网上查资料,在MySQL5.7之前的版本,安全性较低,存在任何用户都可以连接上的 test 库,所以官方在5.7版本加大了对隐私的保护。并且采用了默认 useSSL = true值防止对数据库的随意修改,到了8.0版本,仍然保留了SSL,并且默认值为 true,所以只要将 “?useSSL= false” 放在url表名后即可。

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/306213.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号