Python 2.6 & MySQL

4 02 2009

For any of you who both run Windows and use MySQL as your database backend, you may have found MySQLdb already.  You may also notice that there is no release for Python 2.6.x on the page.  That struck me as odd, since Python has moved into the 2.6 days near the end of 2008, and then shortly thereafter, they announced and release Python 3.  Why hasn’t MySQLdb caught up?

So I’m stuck with Python 2.5.4?  you say.  Not quite– If you run Linux, just compile the MySQLdb source on your 2.6 version of Python, or if you run windows (and heaven knows it’s hell trying to compile anything from source on a windows machine) then you should just download this obscure 2.6 release of MySQLdb.  The only reason I know about it is because I’m on the mod_python mailing list, and someone had a question about the missing 2.6 version.

So that you’re properly warned, Python 2.6 deprecated the Sets module from ImmutableSets, which gives a warning when MySQLdb gets fired up.  MySQLdb works just fine still, but it’ll likely need some work to become compatible with Python 3.




21 responses

7 03 2009

Thanks for this. I was wondering what to do about talking to MySQL.

18 03 2009

You rock. This was about to suck. 🙂

6 05 2009
Tomas Varaneckas

Awesome. I was almost there but gave up after seeing this:

running build_ext
building ‘_mysql’ extension
error: Unable to find vcvarsall.bat

Why the hell does Python 2.6 have to be such a pain…

6 05 2009

That sucks… if only Windows and every flavor of Linux had a mutual equivalent to the Synaptic Package Manager as found in Ubuntu..

5 09 2009

Yeah I got this far as well trying to compile. I downloaded Mingw but that didn’t have the vcvarsall.bat, so I was started download MSVC++ 2008 and I saw this post.

Thanks to whoever made that executable!

23 05 2009
Python 2.6 & Mysql : Retrorock

[…] Artículo original en inglés […]

23 05 2009
Wilbur Suero


I translated your post to spanish in

2 09 2009
Bob Koure

I can move to 2.6.

1 10 2009
David Goadby

This took some finding for sure! I needed 2.6 for HTTP time-outs and was stuck because of MySQLdb. Now there is hope. It’s about time MySQL was formally included as a module.

1 10 2009

Completely agreed– It kills me that Python doesn’t have an official module for MySQL.

21 10 2009

Thanks! I’ve decided to use python to build my system’s thesis … i think it will help me a lot.

13 11 2009

Thank you!!!!!

22 11 2009


29 12 2009

Another thank you to you !!!

4 02 2010

Thanks, this really helped!

9 07 2010

Ehi, good post!
I can use mysql in my python 2.6 on windows with this “obscure” 🙂

5 08 2010

Thanks for this info!
I was getting a bit frustrated when building the package from sources, under Windows, wouldn’t work…

25 08 2010

Thank you. Now it works 🙂

11 01 2011

Just a note in case some of you run into problems: 32-bit version of python is required

11 01 2011

Yes, that is a problem which plagues almost every flagship python module for Windows platforms. 64-bit python is definitely not ready for Windows developers. Another major problem package is PIL, the imaging library!

9 03 2011
Diigo bookmarks 03/09/2011 (p.m.)

[…] Python 2.6 & MySQL […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: