sqlite> DELETE FROM mails WHERE (`id` = 71);
SQL error: database is locked
How do I unlock the database so this will work?
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.