Hi Harry,
If I'm not mistaken, you are using the OtpKeyProv plugin? If so, when you create the database, you also create a OtpKeyProv key which you configure using a secret key, an initial counter, the number of otp you want the plugin to enforce and the look-ahead count.
Before you do that, you are supposed to configure the Yubikey using the personalization tool. It is the first step mentioned on the page (
https://www.yubico.com/applications/password-management/consumer/keepass/). Make sure you copy the secret correctly to the plugin's window and also make sure you select the "Hex" setting (on the right of the secret box in the plugins window). The counter in the plugin's window must be the same as the moving factor in the personalization tool. The number of OTP required is at your discretion. (The more the better but it can become annoying to have 6 as the Yubikey can't be configured to output many OTP one after the other). For the look-ahead count, I recommend at least (n*2)+1 (n being the number of OTP required). Having used the plugin for a while, I can tell you its easy to mess up an OTP. (n*2)+1 gives you the latitude to miss twice and generate one blank and it will still unlock the database.
Also, do not use the Yubikey to generate passwords unless you are unlocking the KeePass database. The passwords are generated using a counter and this counter increments every time you generate a password. If you generate more passwords than the look-ahead count, the generated passwords will not be valid anymore, even if its the right Yuibikey with the right secret.
Hope this helps and let us know if it's still not working.