首页 新闻 会员 周边 捐助

Spring和mybatis的联合使用中出现的问题

0
[待解决问题]

这是控制台的错误信息

Thu Sep 02 00:00:28 CST 2021 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
9月 02, 2021 12:00:29 上午 com.alibaba.druid.support.logging.JakartaCommonsLoggingImpl error
严重: create connection SQLException, url: jdbc:mysql://localhost:3306/hudada, errorCode 0, state 01S00

不知道为什么这里的url,username,password 会变红色
这都困扰我几天了,上网也搜不到,求助大佬解答

也有风雨也有晴的主页 也有风雨也有晴 | 菜鸟二级 | 园豆:204
提问于:2021-09-02 00:11
< >
分享
所有回答(1)
1

You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.

改改你的 url,看起来 jdbc:mysql://localhost:3306/hudada 没有启动SSL,直接在链接后面添加 ?useSSL=false ,试试。

下面是我 使用 spring boot 时配置的一个url:
spring.datasource.url=jdbc:mysql://myhost:3306/db_example?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
仅供参考

快乐的总统95 | 园豆:4004 (老鸟四级) | 2021-09-02 07:50
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册