Python 2.6 & MySQL
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.
24 Responses to Python 2.6 & MySQL
Leave a Reply Cancel reply
Topics
- Design (2)
- Games (2)
- Hacks (15)
- Hard Drives (2)
- Hobbies (13)
- Huh? (2)
- Linux (7)
- Ubuntu (3)
- Mac (18)
- Music (1)
- Operating Systems (10)
- Opt-Out Diaries (1)
- Photo Editing (1)
- Programming (21)
- Java (7)
- Javascript (1)
- Objective-C (1)
- Python (12)
- Textmate (1)
- RAM (1)
- Rants (10)
- Troubleshooting (2)
- Uncategorized (2)
- windows (8)
- Work (1)
- 4500S App Store Chrome dell development dimension Firefox function Google hard drive Hyper-V icon IDE IE Internet Explorer java JavaScript Linux mac Macports method Microsoft mountain lion MySQL MySQLdb Opera OS X panda3d patch php pip plugin productivity Programming Python python 2.5 service pack UI vista wallpaper windows Windows 7 Windows Firewall windows server 2008 xcode






Thanks for this. I was wondering what to do about talking to MySQL.
You rock. This was about to suck.
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…
That sucks… if only Windows and every flavor of Linux had a mutual equivalent to the Synaptic Package Manager as found in Ubuntu..
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!
[...] Artículo original en inglés [...]
Great!
I translated your post to spanish in http://retrorock.info/2009/05/python-26-mysql/
Hooray!
I can move to 2.6.
Thanks!
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.
Completely agreed– It kills me that Python doesn’t have an official module for MySQL.
Thanks! I’ve decided to use python to build my system’s thesis … i think it will help me a lot.
Thank you!!!!!
suh-weeeet
Another thank you to you !!!
Thanks, this really helped!
Ehi, good post!
I can use mysql in my python 2.6 on windows with this “obscure”
Thanks for this info!
I was getting a bit frustrated when building the package from sources, under Windows, wouldn’t work…
Thank you. Now it works
Just a note in case some of you run into problems: 32-bit version of python is required
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!
[...] Python 2.6 & MySQL [...]
You’re a lifesaver.
Hi,
I installed python26 (32bit) and the ‘obscure’ mySQL release…but when importing that via import MySQLdb it says:
“ImportError: DLL load failed: %1 is no valid win32 application.”
Want to use it with maya2012 64bit…maybe THIS is the issue?
I’m not familiar with that specific error, but it makes me think that perhaps MySQL itself isn’t properly installed? MySQLdb is an adapter, “bindings” for communicating with the MySQL installation on the machine.