1.安装database navigator
社区版的pycharm,Tool Windows里没有Database,所以要手动安装Database Navigator:File →Settings→Plugins→搜索框中输入Database Navigator→下载插件→安装完成重启Pycharm(下图我已经按上述方法安装好了database navigator)
2.对mysql进行配置
导航栏中选择DB Navigator,进入Database Browser后在设置里配置mysql。
Authentication下,user填root;password填之前在mysql下配置的密码,其他默认。
3.报错解决
一般情况下,在进行了1、2两步之后会连接成功,但我在连接是却出现了报错:
The server time zone value '�й���ʱ��' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the 'serverTimezone' configuration property) to use a more specifc time zone value if you want to utiliz
报错原因是新版mysql的时区设置有问题,故下面对mysql进行时区更改(照例先登录Mysql,然后输入set global time_zone="+8:00",注意是"+8:00"而不是"8:00",我第一次就输错了,然后报错了):
进行完这一步后,打开Pycharm发现数据库已经连接上了,会提示...successfully