[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

MySQL and restore

Frank Aune

2/27/2008 3:24:00 PM

Hi,

Inspired from http://blog.spikesource.com/mysql_hot...:
I restore a database from an SQL dump like this:

(...)
f= open('test.sql', 'r')
sql = f.read()
f.close()
self.query("""%s""" % sql)
(...)

This works fine for dumps made with "mysqldump -uroot -B test > test.sql".
However, if performing a commit afterwards in the above code, I get
a "command out of sync; you can't run this command now" I even get this when
trying out the SET FOREIGN_KEY_CHECK properties as suggested in the URL.

How do I properly "clearn up" after processing the raw SQL file in the query
above?

Thanks,
Frank