Maven连接数据库是报[08001]Connection to mybatis@localhost failed. [08001] Could not create connection to database server. Attempted reconnect 3 times

错误截图:

 

原因:

 时区不对,url需改成jdbc:mysql://localhost:3306/database?serverTimezone=GMT

添加红色部分到URL区域即可。当然这些前提都必须是数据库连接参数配置无误的情况下。

修改后截图:

 

posted @ 2020-01-15 15:33  奔跑的虫呙牛  阅读(176)  评论(0)    收藏  举报