MySQLdb for Win32

Jeff Bauer jbauer at rubic.com
Sun Feb 27 23:50:56 CET 2000


Chuck Esterbrook wrote:
> Is there a pre-built version of MySQLdb available for Win32?

Dominik Friedrich also wrote:
> did anybody successfully compiled the mysqldb module on a
> win32 system?

Chuck / Dominik:

I've got the dlls to handle the client side of connecting
to MySQL from a Win32/Python environment.  It's available
for ftp download from starship.python.net, ftp directory 
/pub/crew/jbauer:
 
    MySQL.pyd
    libmySQL.dll
 
Place these files in your Python home directory.  Your PATH
should point to wherever libmySQL.dll is located.

Per my notes, here is a scenario to get you started:

D:\jeff\PyMySQL> python

>>> import MySQL
>>> DBH = MySQL.connect('myhost','myuser','mypasswd')
>>> DBH.listdbs()

[['mydb'], ['mysql'], ['test']]

>>> DBH.selectdb('mydb')
>>> STH = DBH.query("select * from mytable")
>>> STH.fetchdict()

... prints list of dicts ...

Note: This is Joseph Skinner's (and James Henstridge's)
original pre-DBI version of the mysql wrapper.  I don't
use mysql on Win32, but other people have reported success
with this release.

Last week David Ascher mentioned that Inprise/Borland 
has made their Windows C++ compiler free for downloading.  
For someone who can't afford the Microsoft compiler -- but 
wants to run python/mysqldb client on Win32 -- this might 
be a suitable project.

The compiler download info is available at:

  http://www.borland.com/bcppbuilder/freecompiler/

oh-yeah-almost-forgot-to-mention-list-comprehensions-map-
reduce-filter-lambda-and-stackless-tail-recursions-ly y'rs,

Jeff Bauer
Rubicon Research




More information about the Python-list mailing list