Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c498e7d

Browse files
committed
Support MySQL Connector/6.1 on Windows
Merge remote-tracking branch 'mysqldb/mysql-connector-6.1'
2 parents 0f1458d + 63df97d commit c498e7d

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

_mysql.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,7 @@ PERFORMANCE OF THIS SOFTWARE.
3838
#endif
3939
#include "pymemcompat.h"
4040
#include "structmember.h"
41-
#if defined(MS_WINDOWS)
42-
#include <config-win.h>
43-
#else
4441
#include "my_config.h"
45-
#endif
4642
#include "mysql.h"
4743
#include "mysqld_error.h"
4844
#include "errmsg.h"

setup_windows.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import os, sys
2+
from distutils.msvccompiler import get_build_version
3+
24

35
def get_config():
46
from setup_common import get_metadata_and_options, enabled, create_release_file
@@ -14,16 +16,17 @@ def get_config():
1416
else:
1517
client = "mysqlclient"
1618

17-
library_dirs = [ os.path.join(connector, r'lib\opt') ]
19+
vcversion = int(get_build_version())
20+
library_dirs = [ os.path.join(connector, r'lib\vs%d' % vcversion) ]
1821
libraries = [ 'kernel32', 'advapi32', 'wsock32', client ]
1922
include_dirs = [ os.path.join(connector, r'include') ]
2023
extra_compile_args = [ '/Zl' ]
21-
24+
2225
name = "MySQL-python"
2326
if enabled(options, 'embedded'):
2427
name = name + "-embedded"
2528
metadata['name'] = name
26-
29+
2730
define_macros = [
2831
('version_info', metadata['version_info']),
2932
('__version__', metadata['version']),

site.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ static = False
1414

1515
# http://stackoverflow.com/questions/1972259/mysql-python-install-problem-using-virtualenv-windows-pip
1616
# 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
17+
connector = C:\Program Files (x86)\MySQL\MySQL Connector C 6.1

0 commit comments

Comments
 (0)