I have problems opening a berkeley db in python using bdtables. As bdtables is used by the library I am using to access the database, I need it to work.
我在使用bdtables在python中打开一个berkeley数据库时遇到问题。由于我用来访问数据库的库使用了bdtables,我需要它才能工作。
The problem seems to be that the db environment I am trying to open (I got a copy of the database to open), is version 4.4 while libdb is version 4.6. I get the following error using bsddb.dbtables.bsdTableDB([dbname],[folder]):
问题似乎是我试图打开的数据库环境(我打开了数据库的副本),版本为4.4,而libdb是版本4.6。我使用bsddb.dbtables.bsdTableDB([dbname],[folder])得到以下错误:
(-30972, "DB_VERSION_MISMATCH: Database environment version mismatch -- Program version 4.6 doesn't match environment version 4.4")
However, bsddb.btopen([dbname]) works.
但是,bsddb.btopen([dbname])有效。
I have also tried installing db4.4-util, db4.5-util and db4.6-util. Trying to use db4.6_verify results in:
我也尝试过安装db4.4-util,db4.5-util和db4.6-util。尝试使用db4.6_verify会导致:
db4.6_verify: Program version 4.6 doesn't match environment version 4.4
db4.6_verify: DB_ENV->open: DB_VERSION_MISMATCH: Database environment version mismatchs
db4.4_verify results in the computer just hanging, and nothing happening.
db4.4_verify导致计算机挂起,没有任何事情发生。
Finally, if I run db4.4_recover on the database, that works. However, afterwards I get the following error 'No such file or directory' in python.
最后,如果我在数据库上运行db4.4_recover,那就可以了。但是,之后我在python中收到以下错误'没有这样的文件或目录'。
2 个解决方案
#1
3
I think answers should go in the "answer" section rather than as an addendum to the question since that marks the question as having an answer on the various question-list pages. I'll do that for you but, if you also get around to doing it, leave a comment on my answer so I can delete it.
我认为答案应该放在“答案”部分,而不是作为问题的附录,因为这标志着问题在各个问题列表页面上有答案。我会帮你做的,但是,如果你还要这样做,请给我的答案留言,这样我就可以删除它。
Quoting "answer in question":
引用“有问题的答案”:
Verifying everything in this question, I eventually solved the problem. The 'No such file or directory' are caused by some __db.XXX files missing. Using
在这个问题中验证一切,我最终解决了这个问题。 “没有这样的文件或目录”是由一些__db.XXX文件丢失引起的。运用
bsddb.dbtables.bsdTableDB([dbname],[folder], create=1)
after db4.4_recover, these files got created and everything is now working.
在db4.4_recover之后,这些文件已经创建,现在一切正常。
Still, it was a bit of an obscure problem, and initially hard to figure out. But thanks to the question Examining Berkeley DB files from the CLI, I got the tools I needed. I'll just post it here if someone ends up with the same problem in the future and end up at *.com
尽管如此,这仍然是一个不起眼的问题,最初很难弄明白。但是由于CLI中检查Berkeley DB文件的问题,我得到了我需要的工具。如果有人在将来遇到同样的问题并最终到达*.com,我会在这里发布
#2
0
Damn, verifying everything in this question I eventually solved the problem. The 'No such file or directory' are caused by some __db.XXX files missing. Using bsddb.dbtables.bsdTableDB([dbname],[folder], create=1) after db4.4_recover, these files got created and everything is now working.
该死的,验证这个问题的一切我最终解决了问题。 “没有这样的文件或目录”是由一些__db.XXX文件丢失引起的。在db4.4_recover之后使用bsddb.dbtables.bsdTableDB([dbname],[folder],create = 1),这些文件已经创建,现在一切正常。
Still, it was a bit of an obscure problem, and initially hard to figure out. But thanks to the question Examining Berkeley DB files from the CLI I got the tools I needed. I'll just post it here if someone ends up with the same problem in the future and end up at *.com
尽管如此,这仍然是一个不起眼的问题,最初很难弄明白。但是由于CLI中检查Berkeley DB文件的问题,我得到了我需要的工具。如果有人在将来遇到同样的问题并最终到达*.com,我会在这里发布
#1
3
I think answers should go in the "answer" section rather than as an addendum to the question since that marks the question as having an answer on the various question-list pages. I'll do that for you but, if you also get around to doing it, leave a comment on my answer so I can delete it.
我认为答案应该放在“答案”部分,而不是作为问题的附录,因为这标志着问题在各个问题列表页面上有答案。我会帮你做的,但是,如果你还要这样做,请给我的答案留言,这样我就可以删除它。
Quoting "answer in question":
引用“有问题的答案”:
Verifying everything in this question, I eventually solved the problem. The 'No such file or directory' are caused by some __db.XXX files missing. Using
在这个问题中验证一切,我最终解决了这个问题。 “没有这样的文件或目录”是由一些__db.XXX文件丢失引起的。运用
bsddb.dbtables.bsdTableDB([dbname],[folder], create=1)
after db4.4_recover, these files got created and everything is now working.
在db4.4_recover之后,这些文件已经创建,现在一切正常。
Still, it was a bit of an obscure problem, and initially hard to figure out. But thanks to the question Examining Berkeley DB files from the CLI, I got the tools I needed. I'll just post it here if someone ends up with the same problem in the future and end up at *.com
尽管如此,这仍然是一个不起眼的问题,最初很难弄明白。但是由于CLI中检查Berkeley DB文件的问题,我得到了我需要的工具。如果有人在将来遇到同样的问题并最终到达*.com,我会在这里发布
#2
0
Damn, verifying everything in this question I eventually solved the problem. The 'No such file or directory' are caused by some __db.XXX files missing. Using bsddb.dbtables.bsdTableDB([dbname],[folder], create=1) after db4.4_recover, these files got created and everything is now working.
该死的,验证这个问题的一切我最终解决了问题。 “没有这样的文件或目录”是由一些__db.XXX文件丢失引起的。在db4.4_recover之后使用bsddb.dbtables.bsdTableDB([dbname],[folder],create = 1),这些文件已经创建,现在一切正常。
Still, it was a bit of an obscure problem, and initially hard to figure out. But thanks to the question Examining Berkeley DB files from the CLI I got the tools I needed. I'll just post it here if someone ends up with the same problem in the future and end up at *.com
尽管如此,这仍然是一个不起眼的问题,最初很难弄明白。但是由于CLI中检查Berkeley DB文件的问题,我得到了我需要的工具。如果有人在将来遇到同样的问题并最终到达*.com,我会在这里发布