Connection to MySQL – @localhost failed.
[08001] Could not create connection to database server. Attempted reconnect 3 times. Giving up.
p>
is because the connection string of MySQL needs to configure the ServerTimezone attribute, which can be used in UTC, Hongkong, Asiz/Shanghai, etc.
if you use UTC, there will be a time difference of 8 hours, so Hongkong or Asiz/Shanghai is recommended.
p>
for example:
jdbc:mysql://localhost:3306/?serverTimezone=Asia/Shanghai
jdbc:mysql://localhost:3306/MyDB?serverTimezone=Asia/Shanghai