How to vacuum sqlite database?

前端 未结 3 2075
醉话见心
醉话见心 2021-02-02 08:27

I want to know how to vacuum sqlite database. I tried a syntax MANUAL VACUUM command for the whole database from command prompt:

 $sqlite3 database_name \"VACUU         


        
3条回答
  •  终归单人心
    2021-02-02 08:32

    Give the command like this:

    $sqlite3 database_name 'VACUUM;'
    

    As a matter of fact, this is the way to do also other queries from command line:

    $sqlite3 database_name 'select * from tablename;'
    

    You can use the full path to the db:

    $sqlite3 /path/to/db/foo.db 'VACUUM;'
    

提交回复
热议问题