PyCharm——[08001] Could not create connection to database server. Attempted reconnect 3 times.

    使用PyChram编辑器链接MySql数据库时报错:[08001] Could not create connection to database server. Attempted reconnect 3 times.

如图所示:

PyCharm——[08001] Could not create connection to database server. Attempted reconnect 3 times.

错误原因是并未设置时区,将时区设置为GMT(格林尼标准时间)即可。

在URL后添加: ?serverTimezone=GMT,如图所示

PyCharm——[08001] Could not create connection to database server. Attempted reconnect 3 times.