今天下载安装MySQL 8.0.28后,打开Workbench,简单看一下Server status,一直提示:Target host is configured as Windows, but seems to be a different OS. Please review the connection settings

然后按照提示提示,在正确设置Installation type,并test connection正常后,问题依然存在。网络搜索下发现这是一个BUG,最近的几个版本都有,是Workbench在获取系统信息因编码问题导致的,解决方案很简单。

打开文件 C:\Program Files\MySQL\MySQL Workbench 8.0\workbench\os_utils.py (具体路径看你的MySQL安装路径)中第356将

process = subprocess.Popen(command, stdin = subprocess.PIPE, encoding=‘utf-8’, stdout = subprocess.PIPE, stderr = subprocess.STDOUT, shell=True)

修改为

process = subprocess.Popen(command, stdin = subprocess.PIPE, encoding=‘ansi’, stdout = subprocess.PIPE, stderr = subprocess.STDOUT, shell=True)

  • 216
  • 0

共 0 回复