ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Create an Empty SQLite Database on Windows

    IT Discussion
    sqlite sqlite3 database relational database windows
    2
    5
    1.9k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • scottalanmillerS
      scottalanmiller
      last edited by

      Lacking the UNIX touch command, you need a way to make an empty database for many SQLite operations. You can use the sqlite3 command directly for this, with the VACUUM statement to create a valid, empty database file for SQLite.

      Assuming we want our database file to be mydatabase.db, you would use the following command:

      sqlite3 mydatabase.db "VACUUM;"
      

      That's it.

      1 Reply Last reply Reply Quote 2
      • DanpD
        Danp
        last edited by

        Appears that the database is created without the VACUUM portion, ie --

        sqlite3 mydatabase.db ;
        
        scottalanmillerS 1 Reply Last reply Reply Quote 0
        • scottalanmillerS
          scottalanmiller @Danp
          last edited by

          @Danp said in Create an Empty SQLite Database on Windows:

          Appears that the database is created without the VACUUM portion, ie --

          sqlite3 mydatabase.db ;
          

          I've tried that and it doesn't work, or at least doesn't always work. Are you testing on Windows?

          DanpD 1 Reply Last reply Reply Quote 0
          • DanpD
            Danp @scottalanmiller
            last edited by

            @scottalanmiller Yes, Windows 10.

            scottalanmillerS 1 Reply Last reply Reply Quote 0
            • scottalanmillerS
              scottalanmiller @Danp
              last edited by

              @Danp said in Create an Empty SQLite Database on Windows:

              @scottalanmiller Yes, Windows 10.

              Odd, didn't work for me.

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post