Sqlite

sqlite:附加的數據庫無法正常工作

  • March 1, 2018

1)我可以從命令行打開數據庫:

bash-3.2 # sqlite3 RecordingDb.sqlite
SQLite version 3.16.2 2017-01-06 16:32:41
Enter ".help" for usage hints.

sqlite> .databases
main: /db/RecordingDb.sqlite

sqlite> select * from recording limit 1;
|110|4||1423222200|1423049398|1423051200|0|0||0|100|||0|0||||1013760|1|11|4|19300||4|4|1801|||4||0|0||||20486|||

2)我可以從 sqlite 提示符附加它,但它不能正常工作:

bash-3.2 # sqlite3
SQLite version 3.16.2 2017-01-06 16:32:41
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.

sqlite> attach database 'RecordingDB.sqlite' as RecordingDb;

sqlite> .databases
main: 
RecordingDb: /db/RecordingDB.sqlite

sqlite> select * from RecordingDb.recording limit 1;
Error: no such table: RecordingDb.recording

為什麼?

類似的問題:

使用多個數據庫?

Linux 具有區分大小寫的文件名。

主要:/db/RecordingDb.sqlite
記錄數據庫:/db/RecordingDB.sqlite
^

引用自:https://dba.stackexchange.com/questions/198713