大家好,又见面了,我是你们的朋友全栈君。
最近更新MySQL到8.0.25版本后,查看ServerStatus,出现“Exception: Current profile has no WMI enabled”错误,出于人的惰性,直接baidu->google->stackoverflow->oracle…然而找到的办法大多是提示:
经过阅读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,经验证也完美解决
回退版本(评论区老哥提出),经过我询问他人确实能解决该问题
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/138606.html原文链接:https://javaforall.cn