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.

jtgrassie
  • 19,601
  • 4
  • 17
  • 54

1 Answers1

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.

jtgrassie
  • 19,601
  • 4
  • 17
  • 54