2

I tried to explore the lmdb using python -mlmdb stat --env C:\ProgramData\bitmonero\lmdb, but got the follwing error message:

MDB_VERSION_MISMATCH: Database environment version mismatch

I am using the latest version of lmdb (0.98), Windows 10. What went wrong here? I will delete and re-sync the lmdb folder as a last resort.

1 Answer 1

2

If you delete the lmdb folder and re-sync you will be in the same position. Just use the version (0.9.70) of mdb_stat that's in the Monero source tree (monero/external/db_drivers/liblmdb).

Also note, the python module version number (0.98) is not the lmdb version number. The python module you reference actually uses lmdb version 0.9.24. Therefore, if you need to use the python wrapper, you're going to have to build that first with the correct version of lmdb as used in Monero (0.9.70).

To use the LMDB library included in the Monero source code, uninstall your currently installed python lmdb module and reinstall following steps like:

cd ~/monero.git/external/db_drivers/liblmdb
make
cd ~
export LMDB_FORCE_SYSTEM=1
export LMDB_INCLUDEDIR=~/monero.git/external/db_drivers/liblmdb
export LMDB_LIBDIR=~/monero.git/external/db_drivers/liblmdb
pip install lmdb

Which ensures the version of LMDB the python module uses is the same version as used by Monero.

8
  • I've downloaded version 0.9.70 from github.com/LMDB/lmdb. How do I go about building the python wrapper with this version of lmdb? I'm sorry, I tried searching for guides on how to do it but couldn't find any. May 26, 2020 at 17:12
  • Edit: also, the latest stable version of lmdb is 0.9.25, but you mentioned that Monero is using 0.9.70. How is that possible? Are the versions named seperately?? May 26, 2020 at 18:24
  • "How do I go about building the python wrapper with this version of lmdb?" <- see the docs: github.com/jnwatson/py-lmdb/blob/master/docs/…
    – jtgrassie
    May 26, 2020 at 18:38
  • "also, the latest stable version of lmdb is 0.9.25, but you mentioned that Monero is using 0.9.70. How is that possible?" <- Because Monero doesn't use a system installed version of liblmdb, it uses a source version which gets built with Monero, and that is the latest version, 0.9.70.
    – jtgrassie
    May 26, 2020 at 18:41
  • I see, in that case, if I clone Monero, I should have 0.9.70 right? Right now I only have the GUI wallet, which is the source of my data.mdb. May 26, 2020 at 19:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.