How do I unlock a SQLite database?

前端 未结 30 1737
栀梦
栀梦 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:30

    The DatabaseIsLocked page listed below is no longer available. The File Locking And Concurrency page describes changes related to file locking introduced in v3 and may be useful for future readers. https://www.sqlite.org/lockingv3.html

    The SQLite wiki DatabaseIsLocked page offers a good explanation of this error message. It states, in part, that the source of contention is internal (to the process emitting the error).

    What this page doesn't explain is how SQLite decides that something in your process holds a lock and what conditions could lead to a false positive.

提交回复
热议问题