10
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

SQLSTATE[HY000]: General error: 5 database is locked 【SQLite】というエラーの対処法・原因

Posted at

laravelでDBいじってたら、エラー出て日本語情報少なかったので記載。

ロックされたデータベースをdatabase.sqliteとすると、これをアンロックするには手順は超簡単。
このデータベースを、作り直すだけ。

mv database.sqlite dummy_database.sqlite

ロックされているSQLite3のデータベースファイルを別名にする。

cp -p dummy_database.sqlite database.sqlite

元ファイルと同じファイル名にコピーして作成。

これでロックを解除できます。

いやー助かった。本当に疲れたーー

こちら下記のサイトに詳しい原因載ってますのでご覧ください。
エラー解決はできたけどあんまり理解出来なかった。

参考サイト

参考サイト

10
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?