被这个问题困扰了很久 连不上本地数据库 连接localhost提示:
Connection to MySQL - @localhost failed. [08001] Could not create connection to database server. Attempted reconnect 3 times. Giving up.
解决方法是 在url后面指定时区serverTimezone=UTC
URL改成:jdbc:mysql://localhost:3306?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
如图