Bug #71126 Command "mysqlfabric" not recognized on Windows platform
Description:
C:\Program Files (x86)\MySQL\MySQL Utilities>mysqlfabric list-commands
Usage: %fabric <group> <cmd> [<option> ...] arg ...
mysqlfabric: error: Command (manage list-commands) was not found.
C:\Program Files (x86)\MySQL\MySQL Utilities>mysqlfabric.exe list-commands
Usage: %fabric <group> <cmd> [<option> ...] arg ...
mysqlfabric.exe: error: Command (manage list-commands) was not found.
C:\Program Files (x86)\MySQL\MySQL Utilities>mysqluc
Launching console ...
Welcome to the MySQL Utilities Client (mysqluc) version 1.4.0
Copyright (c) 2010, 2013 Oracle and/or its affiliates. All rights reserved.
This is a release of dual licensed MySQL Utilities. For the avoidance of
doubt, this particular copy of the software is released
under the version 2 of the GNU General Public License.
MySQL Utilities is brought to you by Oracle.
Type 'help' for a list of commands or press TAB twice for list of utilities.
mysqluc>
How to repeat:
Install the MySQL utilities MSI and run the mysqlfabric command
mysqluc works fine as expected.
Suggested fix:
There are two problems that only happen when mysqlfabric is an executable
file created through the cx_freeze program.
1 - Libraries are in the libraries.zip file and the variable __path__ points
to it.
This is a problem because the find_commands() in mysql.fabric.services
searches recursively for commands in the mysql.fabric.services directory and
sub-directories. This is done as follows:
for imp, name, ispkg in pkgutil.walk_packages(__path__, __name__ + "."):
mod = imp.find_module(name).load_module(name)
_LOGGER.debug("%s %s has got __name__ %s" % (
"Package" if ispkg else "Module", name, mod.__name__))
However, "__path__" is reporting
"C:\Users\alcorrei\workspace\mysql-utilities-1.4.0\build\exe.win-amd64-2.7\lib
rary.zip\mysql\fabric\services" the "walk_packages()" yields an empty
generator since the path is invalid.
2 - __file__ global variable does not exist thus causing problems in the
mysqlfabric script when the configuration file is not provided.
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.039 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.
Description: C:\Program Files (x86)\MySQL\MySQL Utilities>mysqlfabric list-commands Usage: %fabric <group> <cmd> [<option> ...] arg ... mysqlfabric: error: Command (manage list-commands) was not found. C:\Program Files (x86)\MySQL\MySQL Utilities>mysqlfabric.exe list-commands Usage: %fabric <group> <cmd> [<option> ...] arg ... mysqlfabric.exe: error: Command (manage list-commands) was not found. C:\Program Files (x86)\MySQL\MySQL Utilities>mysqluc Launching console ... Welcome to the MySQL Utilities Client (mysqluc) version 1.4.0 Copyright (c) 2010, 2013 Oracle and/or its affiliates. All rights reserved. This is a release of dual licensed MySQL Utilities. For the avoidance of doubt, this particular copy of the software is released under the version 2 of the GNU General Public License. MySQL Utilities is brought to you by Oracle. Type 'help' for a list of commands or press TAB twice for list of utilities. mysqluc> How to repeat: Install the MySQL utilities MSI and run the mysqlfabric command mysqluc works fine as expected. Suggested fix: There are two problems that only happen when mysqlfabric is an executable file created through the cx_freeze program. 1 - Libraries are in the libraries.zip file and the variable __path__ points to it. This is a problem because the find_commands() in mysql.fabric.services searches recursively for commands in the mysql.fabric.services directory and sub-directories. This is done as follows: for imp, name, ispkg in pkgutil.walk_packages(__path__, __name__ + "."): mod = imp.find_module(name).load_module(name) _LOGGER.debug("%s %s has got __name__ %s" % ( "Package" if ispkg else "Module", name, mod.__name__)) However, "__path__" is reporting "C:\Users\alcorrei\workspace\mysql-utilities-1.4.0\build\exe.win-amd64-2.7\lib rary.zip\mysql\fabric\services" the "walk_packages()" yields an empty generator since the path is invalid. 2 - __file__ global variable does not exist thus causing problems in the mysqlfabric script when the configuration file is not provided.