<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<!-- Database connection settings -->
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://localhost:3306/schedule?useSSL=false&autoReconnect=true </property>
<property name="connection.username">root</property>
<property name="connection.password">1234</property>
<!-- JDBC connection pool (use the built-in) -->
<property name="connection.pool_size">1</property>
<!-- SQL dialect -->
<property name="dialect"
>org.hibernate.dialect.MySQLDialect</property>
<!-- Enable Hibernate's automatic session context management -->
<property name="current_session_context_class"
>thread</property>
<!-- Disable the second-level cache -->
<property name="cache.provider_class"
>org.hibernate.cache.NoCacheProvider</property>
<!-- Echo all executed SQL to stdout -->
<property name="show_sql"
>true</property>
<property name="format_sql">true</property>
<property name="hibernate.c3p0.acquire_increment">1</property>
<property name="hibernate.c3p0.idle_test_period">100</property>
<property name="hibernate.c3p0.max_size">10</property>
<property name="hibernate.c3p0.max_statements">10</property>
<property name="hibernate.c3p0.min_size">10</property>
<property name="hibernate.c3p0.timeout">100</property>
<mapping resource="model/modelmap.hbm.xml"/>
</session-factory>
</hibernate-configuration >
这是我的hibernate配置xml文件,我已设置useSSL=false
,但仍然收到警告:
警告:建立没有服务器身份的SSL连接 不建议进行验证。根据MySQL 5.5.45 +,5.6.26 + 和5.7.6+要求默认情况下必须建立SSL连接 如果未设置显式选项。符合现有规定 不使用SSL的应用程序设置了verifyServerCertificate属性 '假'。您需要通过设置明确禁用SSL useSSL = false,或设置useSSL = true并为服务器提供信任库 证书验证。
有人能帮助我吗?
答案 0 :(得分:0)
即使我遇到了同样的错误,问题也出在sql-connector版本上,并且MySql80实例不匹配,我将连接器版本更新到8.0.21后,问题就解决了...