I'm sure this is permissions related ;)
try: en-us
The reason why you logged in fine the first time is because it was the first time accessing the database... but then since it didn't create the access lock file properly because of permissions, it wouldn't allow you to access the database the next time.
I think in this case you would be better off researching how I could be right and doubting your own conclusion rather than doubting my conclusion. I can tell you that since it worked once, it isn't your code... so if it isn't permissions then I'm going with witchery or voodoo as the cause.