发现并解决MySQL8.0.26无法查看ServerStatus的问题

本文详细讲述了在安装MySQL 8.0.26后,MySQLWorkbench遇到的'Exception:CurrentprofilehasnoWMIenabled'错误,重点在于发现是由于编码设置不当引发的,提供了两种解决方案:一是更改系统语言为英文,二是修改os_utils.py文件中的编码设置。
摘要由CSDN通过智能技术生成

 安装MySQL8.0.26后,MySQL WorkBench出现“Exception: Current profile has no WMI enabled”错误

经过阅读log中给出的出错提示:

20:18:21 [ERR][wb_server_management.py:local_run_cmd_windows:407]: Exception executing local command: chcp.com: 'utf-8' codec can't decode byte 0xbb in position 0: invalid start byte
Traceback (most recent call last):
  File "C:\Program Files\MySQL\MySQL Workbench 8.0\modules\wb_server_management.py", line 404, in local_run_cmd_windows
    retcode = OSUtils.exec_command(command, output_handler)
  File "C:\Program Files\MySQL\MySQL Workbench 8.0\workbench\os_utils.py", line 360, in exec_command
    for line in iter(process.stdout.readline, ""):
  File "C:\Program Files\MySQL\MySQL Workbench 8.0\Python\Lib\codecs.py", line 322, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xbb in position 0: invalid start byte



分别打开这三个出错源代码文件,然后根据最后的一句提示,终于发现了出错源头,在os_utils.py源文件中

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

            # Sends all the command output to the listener
            if output_handler:
                for line in iter(process.stdout.readline, ""):


encoding参数是“utf-8”,这就是罪魁祸首。。。。。

解决方案一
直接切换操作系统的语言为英文,重启电脑后,经过验证完美解决

解决方案二
修改上面提到的os_utils.py的源代码,将utf-8改成gbk,然后重启MySQL workbench,经验证也完美解决

参考文献:

# 安装MySQL8.0.25后,出现“Exception: Current profile has no WMI enabled”错误解决方案

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Risehuxyc

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值