IDEA连接数据库失败@localhost failed. [08001] Could not create connection to database server. Attempte
程序员文章站
2022-05-01 15:54:56
...
##关于IDEA连接mysql数据库失败
Connection to aaa@qq.com failed. [08001] Could not create connection to database server. Attempted reconnect 3 times. Giving up.
在URL后面加上?serverTimezone=UTC
连接成功!
根本原因是因为时区设置的问题。
UTC代表的是全球标准时间 ,但是我们使用的时间是北京时区也就是东八区,比实际时间要早8小时。
UTC + (+0800) = 本地(北京)时间
</div>
<link href="https://csdnimg.cn/release/phoenix/mdeditor/markdown_views-60ecaf1f42.css" rel="stylesheet">
</div>
推荐阅读
-
pycharm连接mysql是出现Connection to orm02@127.0.0.1 failed. [08001] Could not create connection to database server. Attempted reconnect 3 times. Giving up.
-
初次使用MYSQL,IDEA连接MYSQL出现 [08001] Could not create connection to database server.
-
IDEA连接数据库失败@localhost failed. [08001] Could not create connection to database server. Attempte
-
Connection to @localhost failed. [08001] Could not create connection to database server. Attempt
-
pycharm连接mysql是出现Connection to orm02@127.0.0.1 failed. [08001] Could not create connection to database server. Attempted reconnect 3 times. Giving up.