Connection to @localhost failed. [08001] Could not create connection to database server. Attempted reconnect 3 times. Giving up

数据库连接不上

 

解决方法一(亲测,有效): 网上找办法,测试了多个,发现一个最好用也最简单的方式:在默认的jdbc:mysql://localhost:3306后面加上 ?serverTimezone=UTC 就完美解决这个问题了~

这种异常的原因是idea的时间和系统的时间不对。

posted @ 2019-10-10 21:09  程大白  阅读(663)  评论(0编辑  收藏  举报