SQLite 表未保存 [英] SQLite Table not saving
问题描述
我有一个关于 SQLite 的查询.我在 Mac OS X 上运行它.我创建了一个表,添加、删除了行、列值,一切正常.但是当我关闭终端并退出并再次重新打开终端时,我之前创建的表不再存在.这是像会话这样的正常行为还是我在某个地方出错了.
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.
推荐答案
您是否按名称连接到数据库.如果不是默认情况下,sqlite3 引擎将创建一个内存数据库,一旦您断开连接,该数据库就会消失.
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
这篇关于SQLite 表未保存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!