I came across a scenario in which the MongoDB password was removed from the DB. Then Lithium showed "Connection was reset.. ", instead of lithium error.
I will explain you step by step:
In Connections.php
Connections::add('default', array(
'type' => 'MongoDb',
'host' => 'localhost',
'database' => 'CWMG'
));
Added user in Mongo:
C:\>Mongo
> use CWMG
> db.addUser('mongo','awesomeness');
Change Connections.php
Connections::add('default', array(
'type' => 'MongoDb',
'host' => 'localhost',
'database' => 'CWMG',
'login' => 'mongo',
'password' => 'awesomeness'
));
Now remove the user from Mongo
db.removeUser('mongo');
Change the connection Connections.php
- now not using password...
Connections::add('default', array(
'type' => 'MongoDb',
'host' => 'localhost',
'database' => 'CWMG'
));
Now, Connections.php will not work; If you browse the site.. we get an error: "Connection was reset", some times it will redirect to another website.
The only solution, I found, is to add the user back in MongoDB and also the same in Lithium.
So my question is how do I remove a user from MongoDB, once added?
Finally, I found the solution. It is MongoDB which stores the password association. To remove it I first tried
Checked for the solution.
Same problem
So I tried the final and the only solution:
Yes! It is now working OK!