diff --git a/MySQLdb/_mysql.c b/MySQLdb/_mysql.c index d42cc54..6a1aa91 100644 --- a/MySQLdb/_mysql.c +++ b/MySQLdb/_mysql.c @@ -29,8 +29,6 @@ PERFORMANCE OF THIS SOFTWARE. #include "pymemcompat.h" #include "structmember.h" #if defined(MS_WINDOWS) -#include -#include #include #else #include "my_config.h" diff --git a/MySQLdb/setup_windows.py b/MySQLdb/setup_windows.py index 411b773..c64b017 100644 --- a/MySQLdb/setup_windows.py +++ b/MySQLdb/setup_windows.py @@ -5,7 +5,7 @@ def get_config(): metadata, options = get_metadata_and_options() serverKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, options['registry_key']) - mysql_root, dummy = _winreg.QueryValueEx(serverKey,'Location') + connector = options["connector"] extra_objects = [] static = enabled(options, 'static') @@ -15,9 +15,9 @@ def get_config(): else: client = "mysqlclient" - library_dirs = [ os.path.join(mysql_root, r'lib\opt') ] + library_dirs = [ os.path.join(connector, r'lib\opt') ] libraries = [ 'kernel32', 'advapi32', 'wsock32', client ] - include_dirs = [ os.path.join(mysql_root, r'include') ] + include_dirs = [ os.path.join(connector, r'include') ] extra_compile_args = [ '/Zl' ] name = "MySQL-python" diff --git a/MySQLdb/site.cfg b/MySQLdb/site.cfg index 5413a1e..2bceb2b 100644 --- a/MySQLdb/site.cfg +++ b/MySQLdb/site.cfg @@ -12,7 +12,6 @@ static = False # setup that requires it. #mysql_config = /usr/local/bin/mysql_config -# The Windows registry key for MySQL. -# This has to be set for Windows builds to work. -# Only change this if you have a different version. -registry_key = SOFTWARE\MySQL AB\MySQL Server 5.0 +# http://stackoverflow.com/questions/1972259/mysql-python-install-problem-using-virtualenv-windows-pip +# Windows connector libs for MySQL. You need a 32-bit connector for your 32-bit Python build. +connector = C:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2 \ No newline at end of file