When attempting to create a legacy wallet using bitcoin-cli, I get the following error:

bitcoin-cli -named createwallet wallet_name="[...]" descriptors=false load_on_startup=true
error code: -4
error message:
Compiled without bdb support (required for legacy wallets)

I already have Berkeley 5.3 and SQLite3 installed and running Bitcoin Core 23. What else do I need?

1 Answer 1


Assuming that you're building in Linux, legacy wallet support will require Berkeley DB 4.8. You can find instructions in the corresponding section along with a helpful install script's location. There is also this comprehensive guide on how to compile bitcoind for testing by Jon Atack, which provides a few more details that might be helpful.

At the end of the mentioned install script, it prints instructions on how to configure the compilation of bitcoind. Look for something along the lines of

db4 build complete.

When compiling bitcoind, run `./configure` in the following way:

  export BDB_PREFIX='<SOME-PATH>/db4'
  ./configure BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" BDB_CFLAGS="-I${BDB_PREFIX}/include" ...

Use these instructions to configure your installation after installing BDB. Run:

  • The export BDB_PREFIX='<SOME-PATH>/db4' from the scripts final output
  • ./autogen.sh
  • Also from the script output use ./configure BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" BDB_CFLAGS="-I${BDB_PREFIX}/include" ..., adding any other parameters you like
  • finally call, make or make install according to your intended outcome
  • Unfortunately, I am still getting the same error. I installed Berkeley DB 4.8 using the suggested script. It is located in /usr/local/BerkeleyDB.4.8. I have restarted the node after the install. Any suggestion?
    – Gervais
    Commented Oct 1, 2022 at 14:12
  • Did you run configure… and make again afterwards? The configure step defines which bdb your install is gonna use.
    – Murch
    Commented Oct 1, 2022 at 14:22
  • Yes, I did the following: '$ tar -xzvfdb-4.8.30.NC.tar.gz' '$ cd db-4.8.30.NC/build_unix/' '$ ../dist/configure --enable-cxx' '$ make' '$ make install' which I can find in '/usr/local/BerkeleyDB.4.8'
    – Gervais
    Commented Oct 1, 2022 at 15:55
  • 1
    You can also build with --with-incompatible-bdb, which allows for building with BDB up to 5.3. The resulting wallet.dat files can't be opened with lower BDB versions, but that isn't necessarily a problem. Commented Oct 1, 2022 at 20:38
  • 1
    After taking a close look at the configure messages while recompiling, I found the problem: configure: WARNING: libdb_cxx headers missing, configure: WARNING: Bitcoin Core requires this library for BDB (legacy) wallet support. Thank you all so much for your help!
    – Gervais
    Commented Oct 2, 2022 at 19:08

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.