I have a query regarding SQLite. I am running it on Mac OS X. I created a table, added, deleted rows,columns values and everything is working fine. But when i close the terminal and exit, and reopen the terminal again, the table that i created previously is no longer there. is thi sthe normal behaviour like session only or am i going wrong somewhere.
Asked
Active
Viewed 4,768 times
4
-
hey, user253987, once someone answered your question "approve it" (click a button below the answer's points). this will give carma to the other users, and show other people who see your question that this is the right answer. – kolinko Jun 26 '12 at 12:34
-
You should mark the correct answer – Dagrooms Jun 11 '15 at 17:43
1 Answers
10
Are you connecting to a database by name. If not by default the sqlite3 engine will create an in-memory database, and that will disappear once you disconnect.
Try starting your session with something like this:
sqlite3 my_database.litedb

My Other Me
- 5,007
- 6
- 41
- 48
-
Hi...Thanks for this info. I did not know that by default the engine creates an in-memory database. That would explain why it is no longer there when i reconnect. But i could not comprehend how to sort this. I am not sure i understand what is meant by connecting to a database by name...Could u slightly elaborate...Thx a billion anyways – Mithun Nair Sep 13 '10 at 06:48
-
Ah...What a n00B i've been... I confused the table we create as the DB...got it...Now it works fine. I never created a db, just created some tables... Thx a lot again buddy! – Mithun Nair Sep 13 '10 at 06:52
-