如何安装MySQL连接器

7 投票
2 回答
6766 浏览
提问于 2025-04-15 16:24

我下载了mysqlDb,在安装的时候遇到了这样的错误:

C:\Documents and Settings\naresh\Desktop\MySQL-python-1.2.3c1>setup.py build
Traceback (most recent call last):
File "C:\Documents and Settings\naresh\Desktop\MySQL-python-1.2.3c1 
\setup.py",line15,      in  
metadata, options = get_config()
File "C:\Documents and Settings\naresh\Desktop\MySQL-python-1.2.3c1
\setup_windows.py",    line 7, in get_config
serverKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, options['registry_key'])
WindowsError: [Error 2] The system cannot find the file specified

我该怎么做才能解决这个问题呢?

2 个回答

0

你需要打开 regedit,也就是注册表编辑器,然后去找到以下路径:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\2.7\InstallPathHKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\2.7\InstallPath\InstallGroup

然后把它们改成看起来像这样: HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.7\InstallPath\InstallGroup

6

你需要在那个文件里修补注册表键,建议你看看这个讨论帖。

在Windows中将MySQL与Python结合

或者你可以下载已经编译好的二进制文件。

http://www.codegood.com/archives/4

撰写回答