idea使用DataBase连接数据库 Free MyBatis Tool自动生成 实体类工具使用

DataBase

DataBase连接数据库

img

设置DataSources

img

  • Host =》IP地址
  • Port =》端口号
  • User =》用户名
  • Password =》密码
  • Database =》连接的数据库

设置驱动 Drives

img

img

tables 文件夹中即所连接数据库中表

Free MyBatis Tool自动生成 实体类,Mapper ,以及mapper.xml

选择表右键 选择Mybatis-Generator

imgimg

报错

连接协议TLS

17:58	javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
			The following required algorithms might be disabled: SSLv3, TLSv1, TLSv1.1, RC4, DES, MD5withRSA, DH keySize < 1024, EC keySize < 224, 3DES_EDE_CBC, anon, NULL, include jdk.disabled.namedCurves. Edit the list of disabled algorithms to include required algorithms. You can try to enable TLSv1 or TLSv1.1 first.
			JDBC driver may have disabled TLS 1.1 and its earlier versions.

解决方法

https://stackoverflow.com/questions/67332909/why-can-java-not-connect-to-mysql-5-7-after-the-latest-jdk-update-and-how-should

答案简述

I just added useSSL=false and it worked for me.

jdbc:mysql://:/?useSSL=false

I have JDK 8, MySQL 5.7 and mysql-connector-java lib with version 5.1.38

This is useful when you want to execute quickly in local environment only (not staging/test/prod)

spring.r2dbc.url=r2dbc:mysql://host:port/dname?tlsVersion=TLSv1.2

I came here because I had the same issue, but unfortunately,

jdbc:mysql://host:port/dbname?enabledTLSProtocols=TLSv1.2

didn’t work for me because I’m using r2dbc. After a little bit of debugging I found out the name of the parameter must be tlsVersion instead, so you can use, for example:

img

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值