开发者

What is the command for importing a sql file and its schema?

开发者 https://www.devze.com 2023-02-11 18:43 出处:网络
I have an empty sqlite3 db. I would like to import a pre-existing one with all of its schema and data. What is the proper code command for that?

I have an empty sqlite3 db. I would like to import a pre-existing one with all of its schema and data. What is the proper code command for that?

I tried :

sqlite3 db/development.sqlite3 < new-sql开发者_Python百科.sql

It flashes by all the data, and a bunch of junk, and the CPU beeps a few times, and nothing changes.

Any ideas?


For all those interested:

sqlite3 new-sql.sql .dump | sqlite3 db/development.sqlite3
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号