记mysql版本问题踩的坑

我的mysql的版本为:8.0.16
JDK版本为:13
报错时用的mysql connector包的版本为:mysql-connector-java-5.1.36-bin

一开始查看对应版本感觉没问题!!这是最坑的!
官网的版本对应如下:
记mysql版本问题踩的坑
我寻思着5.1的兼容我的jdk和mysql版本的呀!然后我就找其他的错误!然鹅,他喵的就是版本问题的错误。最后实在找不出其他错误,更改成了mysql-connector-java-5.1.49-bin(这时候已经绝望了,死马当活马医的心态)。然鹅还有错误:
报错Tue Aug 11 16:52:46 CST 2020 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.

这不是什么大问题呀,查了一下:
解决方式:
Connection connect = DriverManager.getConnection(
“jdbc:mysql://localhost:3306/test?useSSL=false”,“root”,“root”);#加入useSSL=false即可
记mysql版本问题踩的坑

最后总结下其他坑:
1.(之前有疑问的)mysql-connector-java-5.1.49-bin.jar和mysql-connector-java-5.1.49.jar有什么区别----------使用上是没区别的一样的,都可以用,带-bin的文件里在编译的的时候里面多了几个编译用的校验文件而已。
2.下载的jar包最好老老实实通过Project Structure导入
3.下载Mysql-connector-java驱动包:https://blog.csdn.net/TheBestAge/article/details/89817040(下载地址改为:https://dev.mysql.com/downloads/connector/j/5.1.html)