用idea连接数据库竟然失败
报错:
Connection to [email protected] failed. [08001] Could not create connection to database server. Attempted reconnect 3 times. Giving up.
再三仔细确认不是用户名和密码得错误后,经过各种百度查阅,终于找到了解决办法
在url后面加上: ?serverTimezone=UTC即可
根本原因是因为时区设置得问题。UTC代表得是全球标准时间,但是我们使用得北京时间,比实际时间要早8小时
下面就是连接成功啦