Menu

Mysql-python 1.2.3 win32 for python 2.5

Help
Rinze
2010-10-22
2012-09-19
  • Rinze

    Rinze - 2010-10-22

    tl;dr: I managed to build an installer:
    http://www.sendspace.com/file/yg0yol

    For over a day I've been trying to build my own binary of Mysql-python 1.2.3
    for Python 2.5 using Visual Studio 2003. But no matter what I tried, I always
    ended up with a handful of linking errors, or a working installer that was
    dependent on an external libmysql.dll.

    The problem turned out to be that Python 2.5 kinda demands Visual Studio 2003
    and that the Mysql libraries are built using Visual Studio 2008. The solution
    was to download the source code of Mysql's C connector, build that using
    Visual Studio 2003 and use the resulting mysqlclient.lib to build the Mysql-
    python installer.

    Software used: WinXP SP3, Visual Studio 7 .Net 2003, Cmake 2.8.2

    1 - Download and extract the source zip from http://dev.mysql.com/downloads/c
    onnector/c/

    2 - From the command line, inside the root of the mysql source code run: cmake
    -G "Visual Studio 7 .NET 2003"

    3 - This results in a Visual Studio solution file which you open Visual
    Studio.

    4 - Set the configuration to 'Release' and build the solution

    5 - If all goes well, you'll find the mysqlclient.lib in the libmysql\release
    folder.

    When you use that library to link against, you should end up with a working
    installer.

    The only difference is that my version ended up depending on ws2_32 instead of
    wsock32, but that shouldn't give problems. After installation all but 2 Mysql-
    python unit tests were passed, due to mysql user permissions in my hastily
    launched, unconfigured Mysql server.

     
  • Dan

    Dan - 2011-06-28

    This just saved the day... thank you so much!

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.