Python with MySQL

Alex Martelli alex at magenta.com
Sat Aug 5 03:44:29 EDT 2000


<ekw1 at my-deja.com> wrote in message news:8mg4or$sqt$1 at nnrp1.deja.com...
> I am getting the following error when I try to connect to a MySQL
> 3.23.19 database (which I've used MyODBC to set up datasource with).
>
> >>> import ODBC.Windows
> >>> db = ODBC.Windows.Connect("DSN_name")
> Traceback (innermost last):
>   File "<pyshell#15>", line 1, in ?
>     db = ODBC.Windows.Connect("PyNotes")
> NotSupportedError: ('S1C00', 0, "[TCX][MyODBC]MySQL can't use
> transactions", 4226)
>
> I am able to connect to and use a MS Access datasource, but not the
> MySQL datasource.  Can anyone help me with this?  I don't care that I
> can't use transactions.  I am running Python 1.5.2, MySQL 3.23.19 and
> MyODBC 2.50.13, all under Windows 2000 Professional.  Thanks for any

I'm not familiar with either MySQL or MyODBC, but it appears from
the above that Connect, by default, is trying to set up autocommit
(it shouldn't, but I hear it can be compiled that way?).  Else there
would be no reason to raise a NotSupportedError at that point, yet
(only on an explicit attempt on your part to transact/rollback...).
You could try adding an explicit clear_auto_commit=1 parameter.


Alex






More information about the Python-list mailing list