連接mysql報錯——沒有設(shè)置“usessl=false”的問題
報錯信息
Wed Mar 13 17:08:37 CST 2019 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.
1:admin

解決辦法
在配置數(shù)據(jù)庫的URL時,加上usessl=false就可以了。
添加前


添加后


附上Configuration.xml代碼
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<!-- mybatis別名定義 -->
<typeAliases>
<typeAlias alias="User" type="com.mybatis.test.User"/>
</typeAliases>
<environments default="development">
<environment id="development">
<transactionManager type="JDBC"/>
<dataSource type="POOLED">
<property name="driver" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://19****:3306/***?useSSL=false" />
<property name="username" value="***"/>
<property name="password" value="***"/>
</dataSource>
</environment>
</environments>
<!-- mybatis的mapper文件,每個xml配置文件對應(yīng)一個接口 -->
<mappers>
<mapper resource="com/mybatis/test/User.xml"/>
</mappers>
</configuration>以上為個人經(jīng)驗,希望能給大家一個參考,也希望大家多多支持腳本之家。
相關(guān)文章
Mysql入門基礎(chǔ) 數(shù)據(jù)庫創(chuàng)建篇
Mysql入門基礎(chǔ) 數(shù)據(jù)庫創(chuàng)建篇,剛接觸php與mysql的朋友可以參考下。多寫多測試。2010-04-04
淺談Mysql insert on duplicate key 死鎖問
本文介紹了在并發(fā)場景下的 insert on duplicate key update sql 出現(xiàn)的死鎖,經(jīng)過分析發(fā)現(xiàn)這種sql確實比較容易造成死鎖,這篇文章就從分析死鎖展開,到最終如何解決這樣的問題 分享相應(yīng)的思路,感興趣的可以了解一下2022-05-05
MySQL創(chuàng)建數(shù)據(jù)庫和創(chuàng)建數(shù)據(jù)表的操作過程
MySQL?是最常用的數(shù)據(jù)庫,在數(shù)據(jù)庫操作中,基本都是增刪改查操作,簡稱CRUD,這篇文章主要介紹了MySQL創(chuàng)建數(shù)據(jù)庫和創(chuàng)建數(shù)據(jù)表的操作過程,需要的朋友可以參考下2022-11-11
MySQL數(shù)據(jù)備份之mysqldump的使用詳解
下面小編就為大家?guī)硪黄狹ySQL數(shù)據(jù)備份之mysqldump的使用詳解。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2016-11-11

