python mysql interfacing

Thanos Vassilakis tvassila at siac.com
Sat Feb 8 16:46:43 EST 2003


Any one using python and mysql should seriously be considering snakedb

http://www.scriptfoundry.com/modules/snakedb/

It can really make things easier, and also acts as a bridge keeping your
code database independent.


good luck

thanos

----- Forwarded by Thanos Vassilakis/SIAC on 02/08/2003 04:43 PM -----
                                                                                                                                
                    David Brady                                                                                                 
                    <dbrady at computer.o        To:     python-list at python.org                                                    
                    rg>                       cc:                                                                               
                    Sent by:                  Subject:     Re: python mysql interfacing                                         
                    python-list-admin@                                                                                          
                    python.org                                                                                                  
                                                                                                                                
                                                                                                                                
                    02/08/2003 04:03                                                                                            
                    PM                                                                                                          
                                                                                                                                
                                                                                                                                




On Fri, 2003-02-07 at 10:29, vishnu mahendra wrote:
> is there a way in connecting python to mysql using mysql drivers.
> where can i find the drivers

Get the MySQLdb module.  It's hard to find, harder to install, and
nigh-impossible to decipher.  That said, getting Python to talk to your
MySQL database is so wonderful that it makes it all worth it.  Google
for MySQLdb, and pick the sourceforge site.

Here's what worked for me, on a RedHat 8 system:

1. apt-get install MySQL-python.  Getting the rpm didn't work (failed
dependencies without let or hindrance).

2. haul out Paul DuBois' book, "MySQL", and read the section on the C
API.

3. cd to /usr/lib/python2.2/site-packages/MySQLdb/ and read the source
of connections.py and cursors.py.

Was it painful?  Yes.  Is there an easier way?  I desperately hope so.
Once you get it, does it work?  Yes.

Is it worth it?  Oh my, yes.  :-)

If anyone knows a less painful way of getting, setting up, and (still
relevant to my situation, even) finding documentation for the module,
I'd love to hear it.

Cheers,

-dB
--
David Brady
dbrady at computer.org
There are 10 kinds of people in the world: those who understand binary
and those who don't.


--
http://mail.python.org/mailman/listinfo/python-list




-----------------------------------------
This message and its attachments may contain  privileged and confidential information.  If you are not the intended recipient(s), you are prohibited from printing, forwarding, saving or copying this email.  If you have received this e-mail in error, please immediately notify the sender and delete this e-mail and its attachments from your computer.






More information about the Python-list mailing list