Python and MySQL

Magnus Lycka lycka at carmen.se
Wed Nov 2 13:35:20 EST 2005


Aquarius wrote:
> I appologize in advance for this strange (and possibly stupid)
> question.
> 
> I want to know if there is a way to interface a MySQL database without
> Python-MySQL or without installing anything that has C files that need
> to be compiled. The reason for this, is that I want to develop a
> certain web application, but my hosting provider (!#@$!@#%) isn't very
> eager to supply Python-MySQL (or any modules to python). Is there an
> alternative approach I could use to pass around this ridiculos lack of
> functionality?

I assume that MySQL clients talk to servers via sockets, and it should
be possible to write a python client that did that. It's probably some
work though, and it will probably piss MySQL AB off, since it means that
you could write MySQL client apps using whatever license you want
without paying them.

I wrote a prototype for such a client lib for PostgreSQL once, and it
was fairly simple, but the PostgreSQL docs have decent descriptions of
their protocol, while I assume MySQL hasn't since they want people to
use their client libs and pay for that. (If you read the client lib
source and translate that to Python, it should be considered a derivate,
and GPL applies. If you manage to get it to work without reading any
GPLed code, I guess you are entitled to use whatever license you want.)


Disclaimer: IANAL.



More information about the Python-list mailing list