Skip to content

Commit 11ade40

Browse files
author
adustman
committed
Windows build fixes.
1 parent 54cc6fd commit 11ade40

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

MySQLdb/_mysql.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ PERFORMANCE OF THIS SOFTWARE.
2929
#include "pymemcompat.h"
3030
#include "structmember.h"
3131
#if defined(MS_WINDOWS)
32-
#include <winsock2.h>
33-
#include <windows.h>
3432
#include <config-win.h>
3533
#else
3634
#include "my_config.h"

MySQLdb/setup_windows.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ def get_config():
55
metadata, options = get_metadata_and_options()
66

77
serverKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, options['registry_key'])
8-
mysql_root, dummy = _winreg.QueryValueEx(serverKey,'Location')
8+
connector = options["connector"]
99

1010
extra_objects = []
1111
static = enabled(options, 'static')
@@ -15,9 +15,9 @@ def get_config():
1515
else:
1616
client = "mysqlclient"
1717

18-
library_dirs = [ os.path.join(mysql_root, r'lib\opt') ]
18+
library_dirs = [ os.path.join(connector, r'lib\opt') ]
1919
libraries = [ 'kernel32', 'advapi32', 'wsock32', client ]
20-
include_dirs = [ os.path.join(mysql_root, r'include') ]
20+
include_dirs = [ os.path.join(connector, r'include') ]
2121
extra_compile_args = [ '/Zl' ]
2222

2323
name = "MySQL-python"

MySQLdb/site.cfg

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ static = False
1212
# setup that requires it.
1313
#mysql_config = /usr/local/bin/mysql_config
1414

15-
# The Windows registry key for MySQL.
16-
# This has to be set for Windows builds to work.
17-
# Only change this if you have a different version.
18-
registry_key = SOFTWARE\MySQL AB\MySQL Server 5.0
15+
# http://stackoverflow.com/questions/1972259/mysql-python-install-problem-using-virtualenv-windows-pip
16+
# Windows connector libs for MySQL. You need a 32-bit connector for your 32-bit Python build.
17+
connector = C:\Program Files (x86)\MySQL\MySQL Connector C 6.0.2

0 commit comments

Comments
 (0)