Bug #90682 MySQL utilities not working with MySQL 8
Submitted: 29 Apr 2018 17:09 Modified: 13 Jul 2018 7:12
Reporter: Shiv Iyer Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Utilities Severity:S2 (Serious)
Version:1.6.5 OS:CentOS
Assigned to: CPU Architecture:Any

[29 Apr 2018 17:09] Shiv Iyer
Description:
I am trying to use MySQL Utilities in MySQL 8 and getting error 

Traceback (most recent call last):
  File "/usr/bin/mysqldbcompare", line 28, in <module>
    from mysql.utilities.common.tools import check_python_version
ImportError: No module named utilities.common.tools

I have installed all the required packages : 

MySQL utilities:

[root@localhost bin]# rpm -qa | grep mysql-utilities 
mysql-utilities-1.6.5-1.el7.noarch
[root@localhost bin]# 

MySQL connector for Python: 

[root@localhost bin]# rpm -qa | grep mysql-connector 
mysql-connector-python-8.0.11-1.el7.x86_64
[root@localhost bin]# 

How to repeat:
[root@localhost bin]#  mysqldbcompare --server1=root@localhost --server2=root@localhost drupal:employees
Traceback (most recent call last):
  File "/usr/bin/mysqldbcompare", line 28, in <module>
    from mysql.utilities.common.tools import check_python_version
ImportError: No module named utilities.common.tools
[root@localhost bin]# 

Suggested fix:
I believe there is conflict  with Python version shipped with mysql-connector-python-8.0.11-1.el7.x86_64
[30 Apr 2018 9:07] MySQL Verification Team
https://bugs.mysql.com/bug.php?id=90686 marked as duplicate of this one.
[30 Apr 2018 9:52] MySQL Verification Team
Hello Shiv,

Thank you for the report.

Thanks,
Umesh
[12 Jul 2018 13:13] Chuck Bell
Title is incorrect. This is an issue of installation, not access to MySQL 8. BUG#90686 covers the MySQL 8 issue. The error presented here is related to installation. Please consider checking the installation and/or changing the title.
[13 Jul 2018 7:12] MySQL Verification Team
This is duplicate of Bug #88376, please see Bug #88376

root@BugCentOS7 Downloads]# cat /etc/*release
CentOS Linux release 7.5.1804 (Core) 
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

CentOS Linux release 7.5.1804 (Core) 
CentOS Linux release 7.5.1804 (Core) 

root@BugCentOS7 Downloads]# rpm -qa|grep -i mysql
mysql80-community-release-el7-1.noarch
mysql-community-libs-8.0.11-1.el7.x86_64
mysql-community-libs-compat-8.0.11-1.el7.x86_64
mysql-community-client-8.0.11-1.el7.x86_64
mysql-community-common-8.0.11-1.el7.x86_64
mysql-community-server-8.0.11-1.el7.x86_64
[root@BugCentOS7 Downloads]# 
[root@BugCentOS7 Downloads]# yum install mysql-connector-python
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirror.cisp.com
 * epel: archive.linux.duke.edu
 * extras: centos.mirror.constant.com
 * updates: centos.mbni.med.umich.edu
Resolving Dependencies
--> Running transaction check
---> Package mysql-connector-python.x86_64 0:8.0.11-1.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================================================================================================
 Package                                                 Arch                                    Version                                         Repository                                                   Size
===================================================================================================================================================================================================================
Installing:
 mysql-connector-python                                  x86_64                                  8.0.11-1.el7                                    mysql-connectors-community                                  418 k

Transaction Summary
===================================================================================================================================================================================================================
Install  1 Package

Total download size: 418 k
Installed size: 2.5 M
Is this ok [y/d/N]: y
Downloading packages:
mysql-connector-python-8.0.11-1.el7.x86_64.rpm                                                                                                                                              | 418 kB  00:00:05     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : mysql-connector-python-8.0.11-1.el7.x86_64                                                                                                                                                      1/1 
  Verifying  : mysql-connector-python-8.0.11-1.el7.x86_64                                                                                                                                                      1/1 

Installed:
  mysql-connector-python.x86_64 0:8.0.11-1.el7                                                                                                                                                                     

Complete!
[root@BugCentOS7 Downloads]# rpm -qa|grep -i mysql
mysql80-community-release-el7-1.noarch
mysql-community-libs-8.0.11-1.el7.x86_64
mysql-community-libs-compat-8.0.11-1.el7.x86_64
mysql-community-client-8.0.11-1.el7.x86_64
mysql-community-common-8.0.11-1.el7.x86_64
mysql-community-server-8.0.11-1.el7.x86_64
mysql-connector-python-8.0.11-1.el7.x86_64
[root@BugCentOS7 Downloads]# python
Python 2.7.5 (default, Apr 11 2018, 07:36:10) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import mysql.connector
>>> 

root@BugCentOS7 Downloads]# wget https://downloads.mysql.com/archives/get/file/mysql-utilities-1.6.5-1.el7.noarch.rpm
[root@BugCentOS7 Downloads]# yum install mysql-utilities-1.6.5-1.el7.noarch.rpm 
Loaded plugins: fastestmirror, langpacks
Examining mysql-utilities-1.6.5-1.el7.noarch.rpm: mysql-utilities-1.6.5-1.el7.noarch
Marking mysql-utilities-1.6.5-1.el7.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package mysql-utilities.noarch 0:1.6.5-1.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================================================================================================
 Package                                          Arch                                    Version                                       Repository                                                            Size
===================================================================================================================================================================================================================
Installing:
 mysql-utilities                                  noarch                                  1.6.5-1.el7                                   /mysql-utilities-1.6.5-1.el7.noarch                                  3.5 M

Transaction Summary
===================================================================================================================================================================================================================
Install  1 Package

Total size: 3.5 M
Installed size: 3.5 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : mysql-utilities-1.6.5-1.el7.noarch                                                                                                                                                              1/1 
  Verifying  : mysql-utilities-1.6.5-1.el7.noarch                                                                                                                                                              1/1 

Installed:
  mysql-utilities.noarch 0:1.6.5-1.el7                                                                                                                                                                             

Complete!

[root@BugCentOS7 Downloads]# 
[root@BugCentOS7 Downloads]# mysqldiskusage --version
Traceback (most recent call last):
  File "/usr/bin/mysqldiskusage", line 28, in <module>
    from mysql.utilities.common.tools import check_python_version
ImportError: No module named utilities.common.tools

-- workaround was to synlink

[root@BugCentOS7 Downloads]# ln -s /usr/lib/python2.7/site-packages/mysql/utilities /usr/lib64/python2.7/site-packages/mysql/utilities
[root@BugCentOS7 Downloads]# mysqldiskusage --version
MySQL Utilities mysqldiskusage version 1.6.5 
License type: GPLv2