8

1)sudo dpkg -i mysql-connector-python_1.0.12-1ubuntu12.04_all.deb

2)sudo dpkg -i mysql-utilities_1.3.5-1debian6.0_all.deb

(Reading database ... 50871 files and directories currently installed.)
Preparing to replace mysql-utilities 1.3.5 (using mysql-utilities_1.3.5-1debian6.0_all.deb) ...
Unpacking replacement mysql-utilities ...
postrm script for mysql-utilities
foundpython2.7
/opt/bitnami/python/lib/python2.7/site-packages
Setting up mysql-utilities (1.3.5) ...
postinst script for mysql-utilities
python2.7
found
python2.7
/opt/bitnami/python/lib/python2.7/site-packages
Processing triggers for man-db ...

(工作时会提供参数)

3)尝试运行mysqlrplcheck:

$ mysqlrplcheck
Traceback (most recent call last):
  File "./mysqlrplcheck", line 38, in <module>
    from mysql.utilities.common.server import check_hostname_alias
  File "/opt/bitnami/python/lib/python2.7/site-packages/mysql/utilities/common/server.py", line 29, in <module>
    import mysql.connector
ImportError: No module named connector

它没有找到 mysql.connector。我该如何配置?

4

1 回答 1

1

user2767144 通过编辑解决了这个问题:

/usr/local/lib/python2.7/dist-packages/mysql/__init__.py

并添加:

from pkgutil import extend_path
path = extend_path(path, name)
于 2015-03-31T07:50:22.643 回答