I am new to database. I am trying to create a database and table in it. but unable to save and open again after exiting from sqlite. I am using sqlite3 3.6.20 on centOS, when i will enter following command
.save ex1.db or .open ex1.db
it will print following error message.
Error: unknown command or invalid arguments: "save". Enter ".help" for help
Error: unknown command or invalid arguments: "open". Enter ".help" for help
and when Print .help it wont show any command related to save and open existing database. thanks in advance.
as Mike pointed out in his answer, you should provide a file name to put the database in.
If you did a lot of work and you did not provide a file name up front and you work in a version in which the
.save
command is not yet available (you quote thatsqlite3 3.6.20
does not know it and I also do not see it insqlite3 version 3.8.2
) you can use the.backup
commandYou don't need to save. Each transaction writes to disk. (More or less.)
To create the database "test.sl3", you can do this. (From the command line. Programs work about the same way.)
No
.save
. Now load the database again.The data is still there.
You're supposed to provide a filename as an argument for the .save command, e.g.:
docs: http://www.sqlite.org/cli.html