Is there any way can make me using python with mysql on win32

Gerhard Häring gh_pythonlist at gmx.de
Sun Jan 6 06:31:44 CET 2002


Le 06/01/02 à 11:17, Kick écrivit:
> I have tried odbc, but the odbc.odbc function don't allow me transfer user
> and password to mysql and mx.ODBC.Windows.Connect raised a error
> "[TCX][MySQL] doesn't support transaction"
> 
> What shall I do?

I'm sure it's possible with ODBC, but I'd just scrap mxODBC and use
MySQLdb instead (if only because I know it better); it's a DB-API 2.0
Python database for MySQL.

Get it here: http://www.sf.net/projects/mysql-python

You can get Windows installers for Python versions from 1.5.2 up to 2.2.

Then, build a connection with

import MySQLdb
con = MySQLdb.connect(host="somehost", user="someuser",\
                      passwd="somepwd", db="dbname")

Gerhard
-- 
mail:   gerhard <at> bigfoot <dot> de       registered Linux user #64239
web:    http://www.cs.fhm.edu/~ifw00065/    OpenPGP public key id 86AB43C0
public key fingerprint: DEC1 1D02 5743 1159 CD20  A4B6 7B22 6575 86AB 43C0
reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))




More information about the Python-list mailing list