Python & MySQL

Steve Holden steve at holdenweb.com
Tue Apr 5 10:51:40 EDT 2005


jason.massey at gmail.com wrote:
> Hi all,
> 
> I've got a weird problem.  I was running Python 2.3 and MySQLdb and had
> everything running fine.
> 
> Cutting to the chase: After upgrading to 2.4 (and latest modules) the
> MySQLdb functions in Python can connect to the database, do queries and
> do inserts.
> 
> Or rather, it seems to do inserts.  If I just run in the Python command
> line and manually connect to the database and do an insert and then a
> query on what I just inserted the info is there.
> 
> However when I use SQLyog to look at the database the info isn't there.
>  When I close down Python, restart, reconnect and query the info isn't
> there.
> 
> Info inserted from SQLyog is persistant.
> 
> Has anyone had any problems like this before? 
> 
> thanks,
> 
> jason
> 
I suspect you are forgetting to commit your changes to the database, so 
they are being rolled back when you close your connection.

regards
  Steve
-- 
Steve Holden        +1 703 861 4237  +1 800 494 3119
Holden Web LLC             http://www.holdenweb.com/
Python Web Programming  http://pydish.holdenweb.com/




More information about the Python-list mailing list