PyCharm (python) operating SQLite error: sqlite3.OperationalError: database is locked

1. The problem is as follows:

2. Solution:

The solution to this problem is simple

1: First manually disconnect the database connection: (the specific operation is as follows)

(1) Switch to DB Browser

(2) Right-click the database corresponding to the table you want to delete (the database I use is test1.db)

(3) Select "Disconnect" in the menu item, the disconnection is successful, and the prompt is as follows:

2. Re-run and execute the statement, such as: re-execute the delete statement

execution succeed:

3. Congratulations, the problem is solved!

Guess you like

Origin blog.csdn.net/weiybin/article/details/115032451