How do I unlock a SQLite database?

前端 未结 30 1854
栀梦
栀梦 2020-11-22 15:56
sqlite> DELETE FROM mails WHERE (`id` = 71);
SQL error: database is locked

How do I unlock the database so this will work?

30条回答
  •  天命终不由人
    2020-11-22 16:26

    In windows you can try this program http://www.nirsoft.net/utils/opened_files_view.html to find out the process is handling db file. Try closed that program for unlock database

    In Linux and macOS you can do something similar, for example, if your locked file is development.db:

    $ fuser development.db

    This command will show what process is locking the file:

    > development.db: 5430

    Just kill the process...

    kill -9 5430

    ...And your database will be unlocked.

提交回复
热议问题