Problem compiling MySQLdb for Python 2.6 on Win32


I'm using Django and Python 2.6, and I want to grow my application using a MySQL backend. Problem is that there isn't a win32 package for MySQLdb on Python 2.6.

Now I'm no hacker, but I thought I might compile it myself using MSVC++9 Express. But I run into a problem that the compiler quickly can't find config_win.h, which I assume is a header file for MySQL so that the MySQLdb package can know what calls it can make into MySQL.

Am I right? And if so, where do I get the header files for MySQL?


Also see this post on the mysql-python blog: MySQL-python-1.2.3 beta 2 released - dated March 2009. MySQLdb for Python 2.6 is still a work in progress...

Thanks all! I found that I hadn't installed the developer components in MySQL. Once that was done the problem was solved and I easily compiled the MySQLdb for Python 2.6.

I've made the package available at my site.

I think that the header files are shipped with MySQL, just make sure you check the appropriate options when installing (I think that sources and headers are under "developer components" in the installation dialog).

This video can help you solving your question :)
By: admin