MySQL-python Windows 64bit and 32bit distributions

Last Updated on Sunday, 19 September 2010 05:15 Written by Ioannis Lalopoulos Wednesday, 22 April 2009 07:43

UPDATE 19/9/2010: for Python 2.7 look at this post.

I have built two 64bit and two 32bit Windows distributions of the MySQLdb module for Python 2.6.x for both the stable 1.2.2 and the beta 1.2.3c1 versions.

It seems there were no 64bit distribution for Windows (at least for Python 2.6.x) in public and some of the 32bit ones I have tried had not been built with charset support for languages like greek or hebrew (not that I need them since the encoding I use is utf-8).

You can download the distributions from here:

  MySQL-python-1.2.2.win32-py2.6.exe (1,022.8 KiB)

  MySQL-python-1.2.2.win-amd64-py2.6.exe (1.0 MiB)

  MySQL-python-1.2.3c1.win32-py2.6.exe (1,023.2 KiB)

  MySQL-python-1.2.3c1.win-amd64-py2.6.exe (1.0 MiB)

UPDATE – Embedded binaries also available:

For the 64bit embedded versions get:

  MySQL-python-embedded-1.2.2.win-amd64-py2.6.exe (261.0 KiB)

  MySQL-python-embedded-1.2.3c1.win-amd64-py2.6.exe (261.4 KiB)

For the 32bit embedded versions get:

  MySQL-python-embedded-1.2.2.win32-py2.6.exe (231.9 KiB)

  MySQL-python-embedded-1.2.3c1.win32-py2.6.exe (232.3 KiB)

The embedded versions are linked against libmysqld.dll which must be present in the program directory (you will get a dll load fail if it isn’t there) and the share directory must also exist or else the program will crash in MySQLdb.server_init().



60 Comments

  1. Rinze   |  Thursday, 21 October 2010 at 23:06

    A little update about my post: where I wrote python24.dll, it should say python25.dll

    Also, after writing I found your post on the x64 build you made of Mysql-python 1.2.2 for python2.5. It seems to have the same dependencies as my build, including the need for the dynamically linked libmysql.dll.

    The weird thing is still that I also have a x32 build of Mysql-python 1.2.2 for python 2.5, which does not depend on an external libmysql.dll. I’m going to try and get a hold of the guy who built that one.

  2. Rinze   |  Friday, 22 October 2010 at 12:21

    Got it resolved. The trick was to download Mysql C connector’s source code and build that using Visual Studio 2003. The resulting mysqlclient.lib make the last linking errors go away.

    All unit tests passed, except two, which were due to un-configured permissions.

    The only difference now is that _mysql.pyd depends on ws2_32 instead of wsock32, but that shouldn’t give any problems.
    For anyone interested, the installer MySQL-python-1.2.3.win32-py2.5.exe can be found here: http://www.sendspace.com/file/yg0yol

    Use at own risk though 🙂

  3. saber7   |  Tuesday, 14 December 2010 at 10:35

    nice job:D
    thnx very much for this.

  4. Anton   |  Saturday, 15 January 2011 at 18:06

    Thank you man, I’m sick already of mac/linux centric pythonistas, you’ve made my day.

  5. Kosei Kitahara   |  Saturday, 26 February 2011 at 11:23

    Awesome! Thank you so much!

  6. Timm   |  Sunday, 27 March 2011 at 08:59

    Amazing, a real timesaver!! THX a lot!

  7. yuxc   |  Thursday, 14 April 2011 at 11:45

    Thx very very much!I just want to give it up….

  8. Anoop MS   |  Friday, 18 November 2011 at 17:38

    Thanks,

    I dont have a visual studio to compile the code. This helped me a lot.

    Regards,
    MS

  9. Bill   |  Monday, 14 May 2012 at 18:07

    When I try to run either MySQL-python-1.2.3c1.win-amd64-py2.6.exe or MySQL-python-1.2.2.win-amd64-py2.6.exe, the installation program says “Python 2.6 required for this package, which was not found in registry”, even though the Registry lists Python/PythonCore as 2.6. It then asks me to select a Python istallation, but the list is empty.

  10. Geodexter   |  Saturday, 29 September 2012 at 03:02

    Thanks,
    I use arcpy 10.0 and tied to python 2.6.
    Found this page after a lot of searching, gonna tweet your link!

Leave a Reply