java问题修复
1. com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure
- 错误原因及修改方法:
- 是因为后端MySQL版本在8.0及更高版本,在MySQL8.0前驱动为
com.mysql.jdbc.Driver
,8.0之后可以改为com.mysql.cj.jdbc.Driver
; - 如果还是报Communications link failure这个错误,可以在修改jdbc为
jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone = GMT
2. IntelliJ IDEA导入jar包
- 首先先下载好jar包( mybatis),点击Project Structure
2. 找到Dependencies,点击"+"
3. 选择JARS or directories
4. 找到Jar包路径,选择应用就行。
如图所示: