Feb 07, 2016 · Sexy girl... *pc*,. peraturan menyangkut orang, *ASL*, *pmn*, untuk melayu, budak sekolah atau student(dakw),.
Feb 06, 2017 · Sexy girl... *pc*,. peraturan menyangkut orang, *ASL*, *pmn*, untuk melayu, budak sekolah atau student(dakw),.
Jul 15, 2017 · Sexy girl... *pc*,. peraturan menyangkut orang, *ASL*, *pmn*, untuk melayu, budak sekolah atau student(dakw),.Q:
MongoDB and PHP giving error on login
Im trying to connect to a mongoDB server through php and login using the credentials in the PHP code.
This is the PHP code I use:
$mongo_host = 'xx.xx.xx.xx';
$mongo_port = 27017;
$mongo_username = 'xx';
$mongo_password = 'xx';
$mongo = new MongoClient(array(
'host' => $mongo_host,
'port' => $mongo_port,
'db' => 'xx',
'connections' => 1,
'auth' => true,
));
$mongo->connect();
if(!$mongo->selectCollection('xx.xx.xx.xx'))
{
exit("Connection to the mongoDB server has not been established");
}
$mongo->authenticate('x', 'x', array('$external' => true), '$external');
// use x
I am trying to login with user x and password x
The connection is established but when I try to authenticate I get the following error:
Cannot authenticate with admin username and password and external auth enabled
If I remove the $external param in the authenticate function I can login using the connection.
Does anyone know what I am doing wrong?
Thanks
A:
You're using the wrong Authentication mechanism.
Try replacing
$mongo->authenticate('x be359ba680
Related links:
Comments