Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a DB file in sqlite3 using a .schema file

Our client has provided us with a file named db.schema. Now is there a command which I can use to run this file to create a .db file in sqlite3? Can I do this without having to type in all the queries mentioned in the db.schema file?

Please help! Thanks!

like image 706
Anirudh Avatar asked Aug 07 '13 12:08

Anirudh


1 Answers

If that file contains only SQL commands in the correct format, get the sqlite3 command-line tool, and run it like this:

sqlite3 mydatabase.db < db.schema

Many SQLite administration tools also have functions to import such a file.

like image 124
CL. Avatar answered Sep 22 '22 07:09

CL.