Failed to open database/ Failed to change locale for (database) to 'en_US'

前端 未结 4 879
误落风尘
误落风尘 2021-01-20 03:36

I have read solution from Failed to change locale for db '/data/data/my.easymedi.controller/databases/EasyMediInfo.db' to 'en_US' but it doesnt help me. I st

4条回答
  •  粉色の甜心
    2021-01-20 03:38

    Probably the database file is actually corrupted. You can try to open it with sqlitebrowser

    Also, you can do some other checks and try to restore it in case it is corrupted, if you install sqlite in your computer. You can follow this steps:

    1. Get sqlite here and install it
    2. Open command a add path to sqlite oyour environnment variable path to allow you to launch sqlite commands everywhere
    3. Go to the directory, where you have the database, and launch SQLite:

      sqlite3 yourfile.db
      
    4. You can check the database integrity by:

      pragma integrity_check;
      
    5. If it says that the file is ok, then we are lost! If it is corrupted, lets try to restore it.

    Sometimes the best solution for a corrupted sqlite3 database is simple yet effective: Dump and Restore

    1. Export your data to an sql file:

      echo .dump | sqlite3.exe yourdbname.db > yourdbname.sql
      
    2. Change file name mv yourdbname.db yourdbname.db.original

    3. Create a new database with your sql.

      sqlite3.exe -init yourdbname.sql yourdbname.db
      
    4. Open the new file with sqlite browser, and see what happens!

提交回复
热议问题