How do I unlock a database (SOLVED)

Hi Guys

I have a strange problem (well it seems strange to me) I use Keepassx to store all my passwords and I keep the database on my NAS, but for reasons I cannot explain the database has become locked, which means I can open it and view it but i cannot write to it, when I open keepassx I get this message "

The database you are trying to open is locked.
This means that either someone else has opened the file or KeePassX crashed last time it opened the database.

Do you want to open it anyway?

if I click yes I can open the database and view it but I cannot add an entry without creating a new database,
I’ve tried completely un-installing Keepassx and re-installing but it makes no difference

I could possibly solve this problem by creating a new database and deleting the old one but I’m frightened I do something stupid and believe me no one does stupid things quite like me

Any help would be appreciated

Many thanks


Let’s say your database is called mydatabase.kdb

Make SURE the keepassx database is NOT open in ANY PC’s

Once you’re sure it’s closed on ALL PC’s … go to the directory containing the mydatabase.kdb file, and delete the file called mydatabase.kdb.lock

Probably a good idea to backup the database first … ie. copy it to somewhere else.

ok I’ve done that (but i made a copy) I also notice in the same folder as the database was stored there is a folder called "mypasswords.kdb.lock

I don’t know if that’s relevant but I thought I’d mention it

Thank you


you can probably delete that lock file too (or leave it if it has a different name to your database, up to you) … but the important thing is to delete the one with the same name as your database.

Or MOVE it … as long as it’s not in the same directory as the database (and has the same name), you’re OK


Ok I’ve move the lock file to the same directory as i put the database file

NO … you DON’T want it in the same directory (unless keepassx is open) … the lock file will lock the dabatabse.

re-read my last posting (I was editing it when you posted).

The lock file should disappear when you close keepassx … ie. only be present when keepassx is open.

When keepassx is closed there should be NO lock file in the database directory

Ok I’ve fixed that now the database file and the lock file are in different directories

I’m sorry I’m just terrified I lose the data



you won’t loose the data unless you delete the database :slight_smile:

If you’ve copied the database (mypasswords.kdb) to another directory too … ie.backed it up … your 100% safe :wink:

You should regularly create a copy of the database … and save it on another drive/usb key/dropbox/etc.


ok thank you I’m just being paranoid I have another backup anyway on a separate drive so it’s all good :slight_smile:

is it working now ? … can you close, wait a few seconds, then reopen keepassx ?

it’s working fine now thank you

can I move the database file back to my NAS so that I can access the same file from other PC’s on the network ?

I didn’t say to move it off the NAS in the first place :wink: … so Yes, just make sure it isn’t in a directory with a lock file.

then test opening … closing … waiting a few seconds (so it has time to automagically delete the lock file) … and reopening again.

I actually wanted to know if it was working whilst on the NAS … to make sure it wasn’t some kind of permission issue ?

There is still a problem but my Grand-daughter is here and she wants me to play with her on gcompris on her computer can we come back to this ?

Yup … no problem :slight_smile:

Hi again

sorry about the interuption

I put the database file back in it’s original location and it;s wrote a lock file beside it and I’m getting the same problem

Hi again

I’ts working fine now I didn’t follow your instructions properly the first time i went over it again and it seems fine

Thanks again


Okey dokey … thanks for letting me know :slight_smile: