错误一

Communications link failure due to underlying exception
这说明客户端连接数据库失败,是网络都连不上,不是密码错误连不上,需要检查ip、port是否填写正确,mysql server是否启动,其次检查是否被防火墙拦截。

错误二

Client does not support authentication protocol requested by server; consider upgrading MySQL client
这说明客户端连接数据库失败,但不是网络连不上,而是版本不一致问题,如果服务器使用的是8.x,那么mysql-connector-java.jar也应该使用8.x,否则就会报这个错误。

更多推荐

Client does not support authentication protocol requested by server; consider up