Dec 14, 2011

MySQLdb 安装

For
MySQL Server 5.5 + MySQL Connector C 6.0.2

1. read the README windows part
2. site.cfg
modify
registry_key = SOFTWARE\MySQL AB\MySQL Server 5.5        
# the correct version
and add these lines

# Windows connector libs for MySQL.
connector = c:\Program Files\MySQL\MySQL Connector C 6.0.2
# check the correct version

3. setup_windows.py
library_dirs = [ os.path.join(mysql_root, r'lib\opt'), os.path.join(options['connector'], r'lib\opt') ]
libraries = [ 'kernel32', 'advapi32', 'wsock32', client ]
include_dirs = [ os.path.join(mysql_root, r'include'), os.path.join(options['connector'], r'include') ]


4. go to C:\Python2x\Lib\distutils, edit msvc9compiler.py, search for ‘MANIFESTFILE’, you will find the following line
ld_args.append(‘/MANIFESTFILE:’ + temp_manifest)
Then append the following line after the above line,
ld_args.append(‘/MANIFEST’)

5. 
C:\...> python setup.py install
C:\...> python setup.py bdist_wininst

Done

0 comments: