pycharm可视化数据库,错误 :[08001] Could not create connection to database server.

在pycharm2019版本连接数据库时可能遇到连接失败的情况

pycharm可视化数据库,错误 :[08001] Could not create connection to database server.

1.检查user和password是否有错

2.检查连接池是否正确
pycharm可视化数据库,错误 :[08001] Could not create connection to database server.
3.试试更改区时

  1. 使用root用户登录mysql,输入下面命令。

show variables like “%time_zone%”;
set global time_zone = ‘+8:00’;

  1. MYSQL默认美国时间,而中国要迟8小时,因此将时区设置为当前系统时区即可,采用+8:00格式;
    pycharm可视化数据库,错误 :[08001] Could not create connection to database server.
  2. 设置完成重启mysql,输入 show variables like “%time_zone%”; 查看
    pycharm可视化数据库,错误 :[08001] Could not create connection to database server.

可视化数据库时,数据库保持启动状态