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
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
MySQL and restore
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password