先描述一下今天遇到的问题:
今天刚开始是整合mybatis时连接不上数MySQL据库,然后解决方案是在配置信息pom.xml文件中添加一下MySQLconnect

        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.47</version>
        </dependency>

之前是因为没有加版本控制,所以一直是连不上数据库。
添加版本号,添加完后可以连接了但是运行时出现了下面的警告信息,虽然没错误但是强迫症就是要杠。

下面是警告的内容:
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.

解决方案:
修改数据库配置信息
url: jdbc:mysql:///test06?useSSL=false&serverTimezone=UTC
username: root
password: root

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐