0

I have a corrupted DB (fake_db_v3a.sqlite) file which has two tables (user & status) in it. To get rid of corrupted DB, I have dump DB schema and both the tables to a separate SQL file (fake_db_v3a_structure.sql, fake_db_v3a_user.sql, fake_db_v3a_status.sql). Now, I want to create an empty new SQLite DB using this schema. How can I do that?

Any help would be appreciated. Thanks

5
  • Er... cat fake_db_v3a*.sql | sqlite3 new.db or the like? Commented Mar 11, 2020 at 13:22
  • It's showing me the error like this - Error: near "cat" : syntax error. @Shawn Commented Mar 11, 2020 at 21:11
  • If you're using a Windows command prompt instead of a unix shell the syntax might be different. Commented Mar 11, 2020 at 21:41
  • I have tried several commands to import .sql files (includes user & status) to the SQLite database and it did work successfully for user SQL file, however, I'm still unable to get the data from status SQL file to my newly created SQLite database file. Commented Mar 12, 2020 at 22:48
  • Does this answer your question? How to create a DB file in sqlite3 using a .schema file Commented Jun 8, 2021 at 12:05

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.