0

我正在尝试安装 CVSAnaly2,它的安装和运行在链接https://sites.google.com/site/arnamoyswebsite/Welcome/updates-news/howtoinstallandruncvsanaly2inubuntu1110中进行了说明。

但是,当我尝试运行命令cvsanaly2 -u root -p ****时,出现以下错误:

Traceback (most recent call last):
  File "/usr/local/bin/cvsanaly2", line 5, in <module>
    pkg_resources.run_script('cvsanaly2==2.1.0', 'cvsanaly2')
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 467, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1200, in run_script
    execfile(script_filename, namespace, namespace)
  File "/usr/local/lib/python2.7/dist-packages/cvsanaly2-2.1.0-py2.7.egg/EGG-INFO/scripts/cvsanaly2", line 37, in <module>
    retval = pycvsanaly2.main.main (sys.argv[1:])
  File "/usr/local/lib/python2.7/dist-packages/cvsanaly2-2.1.0-py2.7.egg/pycvsanaly2/main.py", line 265, in main
    config.db_hostname)
  File "/usr/local/lib/python2.7/dist-packages/cvsanaly2-2.1.0-py2.7.egg/pycvsanaly2/Database.py", line 604, in create_database
    db.connect ().close ()
  File "/usr/local/lib/python2.7/dist-packages/cvsanaly2-2.1.0-py2.7.egg/pycvsanaly2/Database.py", line 473, in connect
    raise DatabaseException (str (e))
pycvsanaly2.Database.DatabaseException: (2002, "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)")

任何人都知道如何解决这个错误?

谢谢

4

1 回答 1

0

在上面的链接中,提到要安装 Python MySqldb,我们需要使用“sudo apt-get install python-mysqldb”命令。但是,没有提到我们需要先安装MySql Server,然后再安装python-mysqldb。

因此,我使用“sudo apt-get install python-mysqldb”删除了 python mysql。然后,我按照这些步骤使其工作。

1) 使用“sudo apt-get install mysql-server”命令安装 MySql Server 2) 使用“sudo apt-get install python-mysqldb”命令安装 python MySql

而且,它奏效了:)

于 2012-05-25T21:21:22.757 回答