我需要简单地更改数据库的名称,但似乎在SQLite中
我的情况是,我有一个SQLite加密的数据库,现在我想重新命名它。在手动重命名数据库文件后,加密无法正常工作。因此,我尝试使用命令更改数据库的名称。问题看起来是由于加密引起的。
ALTER DATABASE
命令无效。我的情况是,我有一个SQLite加密的数据库,现在我想重新命名它。在手动重命名数据库文件后,加密无法正常工作。因此,我尝试使用命令更改数据库的名称。问题看起来是由于加密引起的。
ALTER DATABASE
命令无效。main
,当您想引用它时,例如当您连接补充数据库时。您可以选择所附加数据库的“虚拟”名称。[someone@somewhere tmp]$ sqlite3 bla.db
SQLite version 3.7.11 2012-03-20 11:35:50
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .databases
seq name file
--- --------------- ----------------------------------------------------------
0 main /tmp/bla.db
sqlite> attach database 'example.db' as another_db;
sqlite> .databases
seq name file
--- --------------- ----------------------------------------------------------
0 main /tmp/bla.db
2 another_db /tmp/example.db
在SQLite中没有数据库名称,因为每个文件只有一个数据库。也许你想要做的是重命名SQLite文件。
.databases
命令可以列出它们。 - intijkS:\>sqlite3 encrypted.db
SQLite version 3.7.9 2011-11-01 00:52:41
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .backup new.db
sqlite> .q
S:\>sqlite3 new.db
SQLite version 3.7.9 2011-11-01 00:52:41
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite>
main
函数来说,可以命名SQLite数据库吗? - Ciro Santilli OurBigBook.com