database 文件扩展名 .DB - 它究竟是什么类型的数据库?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5748754/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 08:10:14  来源:igfitidea点击:

File extension .DB - What kind of database is it exactly?

databasesqliteencryptionfile-extension

提问by Macejkou

I have a database file with .DB file extension. I have been googling and it looks like SQLite. I tried to connect to it using SQLite and SQLite3 drivers and I am getting an error "File is encrypted or not a database".

我有一个带有 .DB 文件扩展名的数据库文件。我一直在谷歌搜索,它看起来像 SQLite。我尝试使用 SQLite 和 SQLite3 驱动程序连接到它,但出现错误“文件已加密或不是数据库”。

So I dont know if file is encrypted or it is not an SQLite database. Are there any other options what should the .DB extension should be? How do I find out that file is encrypted?

所以我不知道文件是加密的还是不是 SQLite 数据库。.DB 扩展名应该是什么,还有其他选择吗?我如何发现该文件已加密?

I tried to open it in the text editor and it is mostly a mess of charaters and some times there are words visible. I have uploaded the file here: http://cl.ly/3k0E01373r3v182a3p1ofor the closer look.

我试图在文本编辑器中打开它,它主要是一堆乱七八糟的字符,有时还有可见的文字。我已将文件上传到此处:http: //cl.ly/3k0E01373r3v182a3p1o以便仔细查看。

Thank you for your hints and ideas what to do and how to work with this file.

感谢您的提示和想法,以及如何使用此文件。

采纳答案by Ronnie Overby

Marco Pontello's TrIDis a great way to determine the type of any file.

Marco Pontello 的 TrID是确定任何文件类型的好方法。

TrID is simple to use. Just run TrID and point it to the file to be analyzed. The file will be read and compared with the definitions in the database. Results are presented in order of highest probability.

TrID 使用简单。只需运行 TrID 并将其指向要分析的文件。该文件将被读取并与数据库中的定义进行比较。结果按概率最高的顺序呈现。

Just download the executable and the latest definitions file into the same directory and then run TrID:

只需将可执行文件和最新定义文件下载到同一目录中,然后运行 ​​TrID:

trid.exe "path/to/file.xyz"

It will output a list of possible file types for the file with a confidence rating. Here's a screenshot of using TrID to analyze a SQLite database file:

它将输出具有置信度评级的文件的可能文件类型列表。这是使用 TrID 分析 SQLite 数据库文件的屏幕截图:

trid results

三重结果

There's also a GUI version called TrIDNet:

还有一个名为TrIDNet的 GUI 版本:

tridnet results

三联网结果

回答by Brian Campbell

If you're on a Unix-like platform (Mac OS X, Linux, etc), you could try running file myfile.dbto see if that can figure out what type of file it is. The fileutilitywill inspect the beginning of the file, looking for any clues like magic numbers, headers, and so on to determine the type of the file.

如果您在类 Unix 平台(Mac OS X、Linux 等)上,您可以尝试运行file myfile.db以查看是否可以确定它是什么类型的文件。该file实用程序将检查文件的开头,寻找任何线索,如幻数、标题等,以确定文件的类型。

回答by Rudie

Look at the first 30 bytes of the file (open it in Notepad or Notepad++ or another simple text viewer). There's usually some kind of tag or extension name in there.

查看文件的前 30 个字节(在 Notepad 或 Notepad++ 或其他简单的文本查看器中打开它)。那里通常有某种标签或扩展名。

Both SQLite 2 and SQLite 3 have a very clear message: "SQLite format 3"for SQLite 3 (obviously) and "** This file contains an SQLite 2.1 database **"for SQLite 2.

SQLite 2 和 SQLite 3 都有一个非常明确的信息:"SQLite format 3"对于 SQLite 3(显然)和"** This file contains an SQLite 2.1 database **"对于 SQLite 2。

edit
Not that encrypted SQLite databases don't have a header like that, since the entire file is encrypted. See siyw's comment below.

编辑
并不是加密的 SQLite 数据库没有这样的标题,因为整个文件都是加密的。请参阅下面的 siyw 评论。

回答by Mike Sherrill 'Cat Recall'

On a Unix-like system (or Cygwin under Windows), the stringsutility will search a file for strings, and print them to stdout. Might help you narrow the field.

在类 Unix 系统(或 Windows 下的 Cygwin)上,该strings实用程序将在文件中搜索字符串,并将它们打印到标准输出。可能会帮助你缩小领域。

There are a lot of programs besides database programs that use a "db" extension, including

除了使用“db”扩展名的数据库程序外,还有很多程序,包括

  • ArcView Object Database File (ESRI)
  • MultiEdit
  • Netscape
  • Palm
  • ArcView 对象数据库文件 (ESRI)
  • 多重编辑
  • 网景
  • 棕榈

and so on. Google "file extensions" for some sites that catalog file extensions and the programs that use them.

等等。某些站点的 Google“文件扩展名”对文件扩展名和使用它们的程序进行了编目。

回答by Steven Fisher

There's no conclusive way to know, because SQLite encrypts the entire database file, including the header.

没有确定的方法可以知道,因为 SQLite 加密了整个数据库文件,包括标题。

Further, there's not a lot of difference to you, except for possible error text to a user if you're prompting them for a password.

此外,对您来说没有太大区别,除非您提示用户输入密码,否则可能会向用户发送错误文本。