DataBase
DataBase连接数据库
设置DataSources
- Host =》IP地址
- Port =》端口号
- User =》用户名
- Password =》密码
- Database =》连接的数据库
设置驱动 Drives
tables 文件夹中即所连接数据库中表
Free MyBatis Tool自动生成 实体类,Mapper ,以及mapper.xml
选择表右键 选择Mybatis-Generator
报错
连接协议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: