How can I import an existing database to my db.py model?

39 views
Skip to first unread message

Gideon George

unread,
Jul 3, 2014, 9:08:55 AM7/3/14
to web...@googlegroups.com

I have successfully changed the default sqlite connection to mysql. Now I want to import an exported file (database.sql) which is an existing database. I need help on how I can do this please

Massimo Di Pierro

unread,
Jul 3, 2014, 10:58:27 AM7/3/14
to web...@googlegroups.com
You should be able from the shell to do:

db = DAL('myql:....')
db.executesql(open('...../database.sql').read())

assuming the file is not too big and fits in ram.
Reply all
Reply to author
Forward
0 new messages