一般情况下,这个错误是因为安装新版mysql,比如:8.0.13,但workbench是6.0的.
一.第一种方式:
首先,通过 Help -> Locate Log Files 找到 workbench 的日志文件所在位置 ~/.mysql/workbench/log ,查看 wb.log 文件中的内容,看到下面一句:
22:22:40 [ERR][wb_admin_export.py:get_mysqldump_version:117]: Could not parse version number from mysqldump:
mysqldump Ver 8.0.13 for Linux on x86_64 (MySQL Community Server - GPL)
/usr/lib/mysql-workbench/modules/
./wb_admin_export.py: log_error("Could not parse version number from %s:\n%s"%(path, output))
def get_mysqldump_version():
path = get_path_to_mysqldump()
if not path:
log_error("mysqldump command was not found, please install it or configure it in Edit -> Preferences -> MySQL")
return None
output = StringIO.StringIO()
rc = local_run_cmd('"%s" --version' % path, output_handler=output.write)
output = output.getvalue()
if rc or not output:
log_error("Error retrieving version from %s:\n%s (exit %s)"%(path, output, rc))
return None
s = re.match(".*Distrib ([\d.a-z]+).*", output)
if not s:
log_error("Could not parse version number from %s:\n%s"%(path, output))
return None
version_group = s.groups()[0]
major, minor, revision = [int(i) for i in version_group.split(".")[:3]]
return Version(major, minor, revision)
其中, s = re.match(".*Distrib ([\d.a-z]+).*", output) 代码应该是用正则表达式提取版本号,修改为:
s = re.match(".*mysqldump Ver ([\d.]+).*", output)
保存,重启workbench就可以了.
---------------------
作者:mole
来源:CSDN
原文:https://blog.csdn.net/mole/article/details/86670509
版权声明:本文为博主原创文章,转载请附上博文链接!
二.第二种方式
下载最新版的workbench,8.0.16,安装就可以解决.
def get_mysqldump_version():
path = get_path_to_mysqldump()
if not path:
log_error("mysqldump command was not found, please install it or configure it in Edit -> Preferences -> Administration")
return None
output = StringIO.StringIO()
rc = local_run_cmd('"%s" --version' % path, output_handler=output.write)
output = output.getvalue()
if rc or not output:
log_error("Error retrieving version from %s:\n%s (exit %s)"%(path, output, rc))
return None
regexp = ".*Ver ([\d.a-z]+).*"
if ("Distrib" in output):
regexp = ".*Distrib ([\d.a-z]+).*"
s = re.match(regexp, output)
if not s:
log_error("Could not parse version number from %s:\n%s"%(path, output))
return None
version_group = s.groups()[0]
major, minor, revision = [int(i) for i in version_group.split(".")[:3]]
return Version(major, minor, revision)