Log in

It took me the longest time to get Python's MySQLdb library running… - Argument

> Recent Entries
> Archive
> Friends
> Profile

Mike Gonzalez (The only good blogger on the internet)
Bitdesigns ~ Bit Santos

October 8th, 2007

Previous Entry Share Next Entry
12:11 pm
It took me the longest time to get Python's MySQLdb library running on Cygwin. Since I technically didn't have Python installed (it wasn't in the Windows registry), I couldn't use the binary provided on Sourceforge. I had to build it from source, but several problems got in the way. I'm blogging the process in case anyone else gets the problem (I found the ultimate solution on some random forum which is tucked deep in the the search results).
  1. mysql_config could not be found as it wasn't on my path. I had to edit one of the cfg files in the MySQLdb directory to find it. (I think it was site.cfg)
  2. I then had to edit mysql_config itself because it wasn't outputting the correct paths. That actually didn't work, so I just copied the libs and includes from the MySQL folder into the paths specified by mysql_config.
  3. I couldn't just rename config-win.h into my_config.h--I got a lot of compile errors. I ended up downloading someone's copy of my_config.h off the internet (and editing out a line which was including some local file of his)
  4. Removed the -lnsl link (or something like that) that mysql_config was including. I hope this doesn't impact anything, but some of my search results showed people removing it safely.
  5. I compiled it with thread safety off. I'm not sure if the thread safety version works on cygwin.
  6. This last one was the trickiest and took hours. I was getting a lot of permission denied errors. After chmodding just about everything related to MySQLdb (I didn't think chmod even made sense on a FAT file system), I found out that mysql.dll was getting cached in HOME/.python_eggs, and that's the dll the module was actually using. I chmodded it +x and FINALLY everything worked.
Reading over this entry, it is quite boring and maybe I should just put this sort of thing on a separate blog.

(1 comment | Leave a comment)


Date:October 8th, 2007 05:31 am (UTC)

> Go to Top