[Gllug] Python MySQL libs

Huw Lynes huw-l at moving-picture.com
Tue Jun 3 16:09:39 UTC 2003


On Tue, 3 Jun 2003 10:57:14 +0100
"Peter Adamson" <peter.adamson at ktsplc.com> wrote:

> Does anyone know of any MySQL - Python libs
> 
> _with_documentation_ ?
> 
> I'm looking at using 
> MySQLdb 

MySQLdb works just fine. The caveats are that you need a copy of mysql
with all the includes and libs to build against. I only mention this
because I've just spent all morning getting it to work on a v.old RedHat
box.

in use:

import MySQLdb

db = MySQLdb.connect(host="somemachine",user="someuser",passwd="xxxxx",
db="test")
cursor = db.cursor()
cmd = "SELECT * FROM test_table"
cursor.execute(cmd)
result = cursor.fetchall()

##############################

Pretty straight forward really. After that the only documentation you
need is an SQL reference.

-- 
| Huw Lynes               | The Moving Picture Company  |
| System Administrator    | 127 Wardour Street          |
|.........................| London, W1F 0NL             | 




-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list