create new sqlite Db

后端 未结 4 2175
被撕碎了的回忆
被撕碎了的回忆 2021-02-13 14:52

I am working on Mac OS X, I want to create a new SQLite DB, and I am using http://www.sqlite.org/quickstart.html as a reference.

I am entering: sqlite3 test.db

相关标签:
4条回答
  • 2021-02-13 15:34

    Because that is the administrative shell prompt. The shell created test.db and is now waiting for you to do something with it thus the sqlite> prompt you see.

    You may want to create table ... at this point.

    0 讨论(0)
  • 2021-02-13 15:38

    It worked. Quit out and test - the database has been created.

    You are now in the SQLite shell, and it is ready to receive commands like CREATE TABLE..., INSERT INTO..., etc.

    If you would prefer not to use the interactive shell, you can build your schema straight from the command line:

    sqlite3 test.db "CREATE TABLE ..."
    

    Or just create an empty database with no schema:

    sqlite3 test.db ""
    

    But that's the same as just creating an empty file, anyway:

    touch test.db
    
    0 讨论(0)
  • 2021-02-13 15:39

    so it is fine. you are prompted to enter commands. create table, insert, select. have fun!

    0 讨论(0)
  • 2021-02-13 15:52

    You're being taken to the SQLite prompt (where you can create tables, add data, etc.). Nothing appears out of the ordinary based on what you've posted.

    0 讨论(0)
提交回复
热议问题